Problem Set 09
Problem Set 09
Markets Data
Prof. Dr. Jonas Dovern
Friedrich-Alexander-Universität Erlangen-Nürnberg
- Problem Set 9 -
Forecasting with R
c. Plot the ACF and the PACF of the first-differences of the unemployment rate.
We want to forecast the unemployment rate for the period from January to November 2022. The
first step is to fit an appropriate ARMA model for the period up to December 2021, the second
step is to calculate the forecast based on the model. To account for the strong seasonal pattern
we also include monthly dummies in the ARMA model and the forecast.
d. Start with adding monthly dummies to the data frame unemp data. (Hint: First create an
indicator variable for each month with the month() command, i.e. a variable that takes
the value 1 in January, 2 in February and so on. Then create the dummy variables all at
once with the dummy_cols() command based on the indicator variable.)
e. Create a new data frame unemp short that only includes data up to December 2021. (Hint:
filter() command.)
f. Fit an ARMA(4,2) model and include the dummies as additional regressors. (Hint: Specify
the option order = c(4,1,2)) such that R takes first differences automatically. Add
additional regressors with the option xreg).
h. Forecast the German unemployment rate from January until November 2022 and include
dummies the respective months. (Hint: Use the forecast() command. You can see in
the script how you can create the correct dummies for the forecast).