Need Advice Debugging MLE Code to Estimate an ARMA(p,q) I'm trying to estimate an unknown ARMA(p,q) series via a Kalman Filter &amp; QMLE.

The issue is most of my optimized likelihood values end up around -350, except one or two which are hugely positive! It doesn't seem likely that adding a single AR or MA lag would cause such a drastic jump in my likelihood function.

I've tried messing around with optimization parameters in Matlab such as MaxFunEval, and MaxIter but I am still finding this issue.

If this is the wrong place for a question like this I apologize in advanced.
If anyone per chance runs into the same issue,

The reason the MLE is exploding is that a system with explosive roots (eigenvalues outside the unit circle), might make the Kalman-filter predictions explode at a point, and thus creating a few very large MLE values. 

The solution is to rig the MLE function s.t. if any of the eigenvalues lie outside the unit circle, return an MLE >=0. Thus the optimization algorithm will be forced to find a stationary local minimum.