Fit a pure seasonal model
As with other models, you can fit seasonal models in R using the sarima()
command in the astsa package.
To get a feeling of how pure seasonal models work, it is best to consider simulated data. We generated 250 observations from a pure seasonal model given by $$X_t = .9 X_{t-12} + W_t + .5 W_{t-12}\,,$$ which we would denote as a SARMA(P = 1, Q = 1)S = 12. Three years of data and the model ACF and PACF are plotted for you.
You will compare the sample ACF and PACF values from the generated data to the true values displayed.
The astsa
package is preloaded for you and the generated data are in x
.
Este ejercicio forma parte del curso
ARIMA Models in R
Instrucciones del ejercicio
- Use
acf2()
to plot the sample ACF and PACF of the generated data to lag 60 and compare to actual values. To estimate to lag 60, set themax.lag
argument equal to60
. - Fit the model to generated data using
sarima()
. In addition to thep
,d
, andq
arguments in yoursarima()
command, specifyP
,D
,Q
, andS
(note that R is case sensitive).
Ejercicio interactivo práctico
Prueba este ejercicio completando el código de muestra.
# Plot sample P/ACF to lag 60 and compare to the true values
acf2(___, max.lag = ___)
# Fit the seasonal model to x
sarima(x, p = 0, d = 0, q = 0, P = ___, D = 0, Q = ___, S = ___)