Simulating ARIMA models
Generating an arbitrary Auto-Regressive Integrated Moving Average (ARIMA) model is easy in R with the arima.sim() function that is part of the built-in {stats} package. In fact I’ve done it extensively in previous blog posts for various illustrative purposes. But one cost of doing this for educational purposes is that the mechanics of generating them are hidden from the user (of course, that’s the point!). As was the case in last week’s post, I’m motivated by teaching purposes. I wanted to show people how an ARIMA model can be created, with high school maths and no special notation, from white noise.
The movie that is (hopefully) playing above shows this. It takes a single series of independent and identical standard normally distributed variables (top left). It shows how this can be turned into (from left to right one row at a time, starting at the top right):
- an autoregressive model of order 1, where each value of x equals the previous value times 0.8, plus the white noise;
- a moving average of order 1, where each value of x equals the latest bit of white noise plus 0.8 times the previous value of white noise;
- an autoregressive moving average model of order (1, 1), combining the two;
- an ARIMA(1, 1, 1) model that is the cumulative sum of the ARMA(1, 1); and
- an ARIMA(2, 2, 2) model that is like all the above but with extra parameters and an extra cumulative sum stage
One interesting thing is how the AR(1) and ARMA(1, 1) models look almost identical, except for the larger variance of the ARMA(1, 1) model which comes from throwing into the mix 80% of the last period’s randomness. This similarity is just a result of the the particular parameters chosen – …read more
Source:: r-bloggers.com