# 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 & 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.

• Please clarify: what you are saying is that, for a few $(p,q)$ specifications you get a "hugely positive" likelihood values, while the likelihood values of all other specifications you tried cluster at the value $-350$? Mar 19 '16 at 1:23
• I'm estimating via MLE models $p \in 1,2,\ldots,7$ and $q \in 0,1,\ldots,7$. Most all of my likelihood values are either -350, but some are below -1000. Each time fmincon (I'm restricting $\sigma$ to be positive) returns a positive value (around 300-600) for a specifications and estimates a system with explosive AR roots. I know the process is stationary. We then need to use the AIC to choose the best model. My issue is that the positive log-likelihood always gets the smallest AIC which I'm convinced is a mistake. Mar 19 '16 at 1:39