Filtering is the key for fitting many useful models, but now generalization from AR(1) to all kinds of AR(m) and/or MA(l) models is required. The general notion of an ARMA(m,l) model is developed.
The ARMA(m,l) model: ϵj = ∑ms = 1αsϵj − s + ∑lr = 1 − brwj − r + wj where the white noise components have been combined. A rationale will be developed for arguing that, in practice, all such models can be treated as AR(∞), and approximated by AR(m), for some sufficiently large m.
The most general ARMA(m,l) models can be simulated in R using the arima.sim() function. For example, consider the ARMA(2,2) model given by ϵn = 0.6ϵn − 1 − 0.25ϵn − 2 + wn − 1.1wn − 1 + 0.28wn − 2. The command to simulate a series of 200 such errors in R, with a standard deviation of 2.0, is arima.sim(n = 200, list(ar =c(0.6, -0.25),ma = c(1.1, -0.28)), sd = 2.0). Notice that the sign convention in R, for the MA(l) part of the function, is the opposite of this book.