3
$\begingroup$

This may be hard to find, but I'd like to read a well-explained auto-regressive model example that:

  • uses minimal math

  • extends the discussion beyond building a model into using that model to forecast specific cases

  • uses graphics as well as numerical results to characterize the fit between forecasted and actual values

Ideally I would like to understand how to apply the AR model with a simple example. As in - given an array of a car's velocity over time:

[(23,1), (28,2), (19, 3), (25, 4), (30, 5)]

Where first number is the speed and second number is time - how can I apply AR to this data set and forecast the next data point?

If you can't provide an example - could you point me to literature where I can find it?

$\endgroup$
  • $\begingroup$ stats.stackexchange.com/questions/6498/… is a post that I made to answer your type of question. Hope this helps . If you have any questions or concerns please feel free to get back to me in any manner. $\endgroup$ – IrishStat Oct 6 '16 at 12:38
2
$\begingroup$

I would recommend playing around with the statistics in R, if you're familiar with R.

use arima.sim() to generate time series with different characteristics (order=c(1,0,0) for an AR(1) model)

then you can use arima() or ar() functions to estimate the parameters.

To graphically understand whats going on, use pacf() and acf() to plot the partial/ autocorrelation function of the simulated time series. These plots are used as diagnostic plots.

If you have a strictly AR process, you should see a single peak in the pacf() plot, and the location of the peak indicates the order of the AR process. For the AR process, the acf() plot should decay to zero. Also, the directions of the peaks in the pacf() and acf() plots is indicative of the sign of the AR() coefficients.

#Example of AR(1) process
testAR1 <- arima.sim(n=100, list(ar=c(0.75)))
dev.new(width=7, height=4); par(mfrow=c(1,2), mar=c(4,4,0.5,0.5))
acf(testAR1) #notice how the acf decays towards 0, then oscillates around 0
pacf(testAR1) #there is a single significant peak at 1, indicating the order of the AR is 1

#Example of AR(2) process
testAR2 <- arima.sim(n=1000, list(ar=c(0.55, 0.3)))
dev.new(width=7, height=4); par(mfrow=c(1,2), mar=c(4,4,0.5,0.5))
acf(testAR2) #the total AR order of the process is higher than in the previous example (0.55 + 0.3 = 0.85), so the decay is much slower. 
#Also, note that you'll have to increase the sample size of your simulation to get exemplary diagnostic plots of 
#more complicated AR() processes (i.e., higher order), 
#or more subtle AR() processes (smaller coefficients). 
pacf(testAR2) #notice the significant peaks at 1 & 2, indicating the order

#Example of AR(1) process when the coefficient is negative
testAR1_neg <- arima.sim(n=100, list(ar=c(-0.75)))
dev.new(width=7, height=4); par(mfrow=c(1,2), mar=c(4,4,0.5,0.5))
acf(testAR1_neg) #notice that the sign switches between + and -;
pacf(testAR1_neg) #the peak is at 1, and is negative, indicating AR(1) with negative coeff

Things then change a bit when you are looking at a MA process, or a process that is a combination of AR and MA. You didn't ask about these, so I won't explain. However, I should point out that a car driving with cruise control on is one of the few examples of an MA process that seemed intuitive to me when I was first learning about ARIMA models.

Best of luck.

$\endgroup$
0
$\begingroup$

If you have some familiarity with R, this youtube tutorial may be useful.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.