Get startedGet started for free

Fit a mixed seasonal model

Pure seasonal dependence such as that explored earlier in this chapter is relatively rare. Most seasonal time series have mixed dependence, meaning only some of the variation is explained by seasonal trends.

Recall that the full seasonal model is denoted by SARIMA(p,d,q)x(P,D,Q)S where capital letters denote the seasonal orders.

As before, this exercise asks you to compare the sample P/ACF pair to the true values for some simulated seasonal data and fit a model to the data using sarima(). This time, the simulated data come from a mixed seasonal model, SARIMA(0,0,1)x(0,0,1)12. The plots show three years of data, as well as the model ACF and PACF. Notice that, as opposed to the pure seasonal model, there are correlations at the nonseasonal lags as well as the seasonal lags.

As always, the astsa package is preloaded. The generated data are in x.

This exercise is part of the course

ARIMA Models in R

View Course

Exercise instructions

  • Plot the sample ACF and PACF of the generated data to lag 60 (max.lag = 60) and compare them to the actual values.
  • Fit the model to generated data (x) using sarima(). As in the previous exercise, be sure to specify the additional seasonal arguments in your sarima() command.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Plot sample P/ACF pair to lag 60 and compare to actual


# Fit the seasonal model to x

Edit and Run Code