Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Lab 3: ETS and Stationary Data

Overview
Here we are covering two different concepts: stationary data and the ETS method of forecasting.

Set-up
1. Load the fpp3 and tidyverse libraries into R

Lab Steps
Today we’re going to work with stock data. This data is problematic because it is generally “irregular”, it
is has many gaps because stock markets are closed on the weekends and holidays.

1. Create a new variable apple_2017 by filtering gafa_stock for “AAPL” from the year 2017, then create
a tsibble for this using the same technique seen in-class for the Google stock data
2. Time plot the Close column from apple_2017
3. Plot the ACF of the Close column
4. Explain whether this appears to be stationary or not
5. Mutate the apple_2017 dataset so it has a “diff” column which is the first difference of Close
6. Time plot the diff column, as well as its ACF
7. Explain whether diff is stationary or not
8. Forecast Close using ETS with additive errors, additive trend and no seasonal effects (Note that ETS
does NOT require stationary data, so we can use Close instead of diff here)
9. Plot the forecast

You might also like