## 5.13 Problems

For these problems, use the catch landings from Greek waters (greeklandings) and the Chinook landings (chinook) in Washington data. Load the data as follows:

data(greeklandings, package = "atsalibrary")
landings <- greeklandings
data(chinook, package = "atsalibrary")
chinook <- chinook.month
1. Augmented Dickey-Fuller tests in R.

1. What is the null hypothesis for the Dickey-Fuller and Augmented Dickey-Fuller tests?

2. How do the Dickey-Fuller and Augmented Dickey-Fuller tests differ?

3. For adf.test(), does the test allow the data to have a non-zero level? Does the test allow the data to be stationarity around a trend (a linear slope)?

4. For ur.df(), what does type = “none,” “drift,” and “trend” mean? Which one gives you the same result as adf.test()? What do you have to set the lags equal to get the default lags in adf.test()?

5. For ur.df(), how do you determine if the null hypothesis is rejected?

6. For ur.df(), how do you determine if there is a significant trend in the data? How do you determine if the intercept is different than zero?

2. KPSS tests in R.

1. What is the null hypothesis for the KPSS test?

2. For kpss.test(), what does setting null equal to “Level” versus “Trend” change?

3. Repeat the stationarity tests for sardine 1964-1987 in the landings data set. Here is how to set up the data for another species.

datdf <- subset(landings, Species == "Sardine")
dat <- ts(datdf$log.metric.tons, start = 1964) dat <- window(dat, start = 1964, end = 1987) 1. Do a Dickey-Fuller (DF) test using ur.df() and adf.test(). You will have to set the lags. What does the result tell you? Note for ur.df() use summary(ur.df(...)) and look at the bottom of the summary information for the test statistics and critical values. The first test statistic is the one you want, labeled tau (or tau3). 2. Do an Augmented Dickey-Fuller (ADF) test using ur.df(). How did you choose to set the lags? How is the ADF test different than the DF test? 3. Do a KPSS test using kpss.test(). What does the result tell you? 4. Use the anchovy 1964-2007 data [Corrected 1/20. If you did the HW with 1964-1987, that’s fine but part b won’t have any models within 2 of the best for the shorter series.]. Fit this time series using auto.arima() with trace=TRUE. forecast::auto.arima(anchovy, trace = TRUE) 1. Fit each of the models listed using Arima() and show that you can produce the same AICc value that is shown in the trace table. 2. What models are within $$\Delta$$AICc of 2 of the best model (model with lowest AICc)? What is different about these models? 5. Repeat the stationarity tests and differencing tests for anchovy using the following two time ranges: 1964-1987 and 1988-2007. The following shows you how to subset the data: datdf <- subset(landings, Species == "Anchovy") dat <- ts(datdf$log.metric.tons, start = 1964)
dat64.87 <- window(dat, start = 1964, end = 1987)
1. Plot the time series for the two time periods. For the kpss.test(), which null is appropriate, “Level” or “Trend?”

2. Do the conclusions regarding stationarity and the amount of differencing needed change depending on which time period you analyze? For both time periods, use adf.test() with default values and kpss.test() with null=“Trend.”

3. Fit each time period using auto.arima(). Do the selected models change? What do the coefficients mean? Coefficients means the mean and drifts terms and the AR and MA terms.

4. Discuss the best models for each time period. How are they different?

5. You cannot compare the AIC values for an Arima(0,1,0) and Arima(0,0,1). Why do you think that is? Hint when comparing AICs, the data being fit must be the same for each model.

6. For the anchovy 1964-2007 data, use auto.arima() with stepwise=FALSE to fit models.

1. find the set of models within $$\Delta AICc=2$$ of the top model.

2. Use Arima() to fit the models with Inf or -Inf in the list. Does the set of models within $$\Delta AICc=2$$ change?

3. Create a 5-year forecast for each of the top 3 models according to AICc.

4. How do the forecasts differ in trend and size of prediction intervals?

7. Using the chinook data set,

1. Set up a monthly time series object for the Chinook log metric tons catch for Jan 1990 to Dec 2015.

2. Fit a seasonal model to the Chinook Jan 1990 to Dec 1999 data using auto.arima().

3. Create a forecast through 2015 using the model in part b.

4. Plot the forecast with the 2014 and 2015 actual landings added as data points.

5. The model from part b has drift. Fit this model using Arima() without drift and compare the 2015 forecast with this model.