Interpretation of autocorrelation function to determine number of lags in AR model?

7 views (last 30 days)
Hey everyone!
I am pretty new to AR and ARMA models...or well I never understood them in class either... but I am supposed to develop an AR model for the prediction of the generated solar energy by a photovoltaic plant.
Now I understand that I have to look at the autocorrelation function and partial autocorrelation function to determine the number of lags of my AR model. I created it with matlab:
I have researched the internet quiet a bit on how to interpret these results but overall I am totally and utterly lost. Looking at the created partial autocorrelation function I would assume that maybe I need an AR(6) model because the first 6 lags are out of the blue lines... or maybe only AR(1) or AR(2) because the partial autocorrelations at these lags are extremly significant?? But my brain tells me that i should also include lag 24. Which of the two graphics is supposed to tell me that?? And how can the autocorrelation function (not partial!) help me in any way?
I know that this is now a primary matlab question and I apologize for it, but this is the only place I could think of where there might be anyone able to help me...
Thank you sooo much!!

Accepted Answer

Roger Wohlwend
Roger Wohlwend on 3 Nov 2014
Edited: Roger Wohlwend on 3 Nov 2014
The autocorrelation function is a bit odd because the autocorrelations do not subside as they should do. That suggests that there is no adequate AR model. The partial autocorrelation function is more helpful. The highest peaks seem to be a lags 2 and 3. So I would start with those lags. Or you could do something else.
Determining the model order from the autocorrelation and partial autocorrelation is a bit of an art. I believe that it is not necessary to do that these days. Computers are so fast that it is no problem to estimate severals models and pick the best one. In my opinion that is the way how to determine the model order these days. Using the autocorrealation and partial autocorrrelation functions seems to be the correct method of the old days when estimating a model was a lot of work.
So, estimate several models using a loop and calculate the Akaike information criterion for each model. Then pick the model with the lowest AIC. The process is also described in this Matlab example. Don't forget to check the residuals. They must be free of autocorrelation.
  4 Comments
MC3105
MC3105 on 4 Nov 2014
oh I'm sorry... I must have gotten confused with my models... I am creating an AR model as well as an SARIMA model for the same data... later I want to compare the models. I am having coefficients = 1 for the MA and SMA lags in my SARIMA model even though I am working with stationary data... do you know what the problem might be?
Roger Wohlwend
Roger Wohlwend on 4 Nov 2014
A coefficient of 1 for an MA or SMA term is allowed, as far as I know. The important thing is that the MA part is invertible.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!