0% found this document useful (0 votes)
9 views

Problem Set 09

Uploaded by

14Donggeun Ahn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Problem Set 09

Uploaded by

14Donggeun Ahn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Analysis of Macroeconomic and Financial

Markets Data
Prof. Dr. Jonas Dovern

Friedrich-Alexander-Universität Erlangen-Nürnberg

- Problem Set 9 -
Forecasting with R

Problem 1: Forecast of the German unemployment rate


a. Read the data set Problem Set 09 unemp.csv into your work space. The data contains
monthly German unemployment rates from January 1992 until November 2022.

b. Plot the German unemployment rate (u rate). What do you observe?

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).

g. Visually examine the fitted values and the residuals.

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).

i. Plot the forecast with the autoplot() command.

You might also like