1. AR and MA models
In this chapter, you will learn how to fit ARMA models to stationary time series.
2. AR and MA Models
The first problem is how to identify an ARMA model from data. We have generated data from an AR(1) and from an MA(1) and you will notice that they look similar. Thus, you cannot identify a model from simply looking at the data.
3. ACF and PACF
The tools that are used to identify the model orders are the autocorrelation function (or ACF) and the partial autocorrelation function (or PACF).
If a process is pure AR, then the ACF will tail off and the PACF will cut off at lag p.
For a pure MA, it's the opposite- the PACF tails off and the ACF cuts off at lag q.
If both are tailing off, then the model is ARMA- start with orders p equals q equals 1 and add more as needed. It is not possible for both the ACF and PACF to cut off.
4. ACF and PACF
For example, here you see the ACF and PACF of an AR(2). Note that the ACF is tailing off, while the PACF cuts off after lag 2.
5. ACF and PACF
In this example,
6. ACF and PACF
you see the ACF and PACF of an MA(1). In this case, the ACF cuts off after lag 1, while the PACF tails off.
If both the ACF and PACF tail off, then the process is ARMA. We'll discuss that later in this chapter.
Note that it is not possible for both the ACF and PACF to cut off.
7. Estimation
Estimation for time series regression models is similar to regression where you used least squares. For time series it is much harder and the results are not explicit. However, least squares can be accomplished using numerical techniques developed by Gauss and Newton.
8. Estimation with astsa
Here are two examples of how to fit a model using sarima from the package astsa. You are using simulated data so you can compare the estimates to the truth.
First we simulated 200 observations from an AR(2) with parameters 1-point-5 and -.75 and a mean of 50. You generated and plotted data from this model in the previous chapter. To use sarima, simply specify the data object and the particular orders. The sarima output has many elements, but here, we'll concentrate on the t-table. Here, you see that the parameter estimates are close to the actual values.
9. Estimation with astsa
Next, we simulated data from an MA(1) and used sarima to fit the model. Again note that the true parameter of -.7 and the estimated parameter are close. Also, the mean is zero and the estimate is not significant (p equals point-09).
10. Let's practice!