factor analysis and prediction on time series

profileChengLong
assignment.pdf

Applied Macroeconometrics 2019

Assignment Part I

Instructions

This is a set of three assignments, each counting for 10% of your grade. The as-

signments are individual, meaning that you cannot cooperate with other students

or copy their results.

Write a report of max 15 pages (not counting an appendix where you can place

not very important tables and figures, as well as code). The report should be fully

self-contained, so that a fellow student who is not following this course is able to

read and understand what you have done.

You can use any statistical software that you want to complete this assignment.

Submit your assignment to [email protected] with the name AM-19-XXXXXX.pdf with

your student number in place of XXXXXX. Make sure you mention your name and

student number at the start of your assignment.

Deadline: March 31, 23:59

Note: Motivate your answers and reflect on your findings. Example: if I ask you

to date business cycles, you can show the business cycles in a plot (ok), analyze

the coherence with the NBER recession dates (good!), identify where the main

differences are and offer possible explanations on the origin of these differences

(good!!).

1

Assignment 1 and 2

Background information

Blanchard and Quah (1989), henceforth BQ, consider the relation between real

GDP growth and unemployment. Since wages are set to maximize employment,

they do not appear explicitly in their model. In a comment on BQ, Gamber and

Joutz (1993), henceforth GJ, explicitly include real wages in their empirical ana-

lysis to identify the effect of labor supply and demand shocks. The first sentence

of their article is: “The cyclical behavior of real wages is potentially a powerful

indicator of the driving force behind business cycles.” In recent years, it seems

that wages appear to be lagging with economic recovery following the financial

crises. In the light of this observation, we will repeat the analysis of GJ on more

recent data in Assignment 1 and 2.

Data

The data you need can be obtained from the Federal Reserve Bank in St. Lousis

(fred.stlouisfed.org). The following data is used by GJ: “... the average hourly

earnings in U.S. manufacturing deflated by [red.: divided by] the gross national

product implicit price deflator, GNP in 1982 dollars, and the unemployment rate

for males 20 years old and older. The data are quarterly from 1948Q1-1990Q4.”

You can download the following data from fred.stlouisfed.org.

1. Average Hourly Earnings of Production and Nonsupervisory Employees:

Manufacturing (monthly, download both seasonally adjusted and unadjusted

data)

• deflate the seasonally adjusted data using: Gross National Product: Implicit Price Deflator (quarterly, seasonally adjusted)

2. Gross National Product (quarterly, seasonally adjusted)

3. Unemployment rate: 20 years and over (monthly, seasonally adjusted)

You can convert monthly to quarterly data by averaging the data over the months

within a quarter.

2

Assignment 1: Data and stationarity

1. Visualize and describe the three seasonally adjusted series you have obtained.

Do this for the full length of the data, the period up to 1990Q4 and the period

from 1991Q1 onwards.

2. Use the BBQ rule to identify peaks and troughs in both the earnings and

the unemployment rate. Compare these peaks and troughs to the NBER

recession dates.

3. Compare seasonally adjusted and non-seasonally adjusted earnings. Use the

X13-ARIMA methodology discussed in Lecture 1 to extract the seasonal

component yourself. How does it compare to the seasonal component you

find by dividing the published non-seasonally adjusted series by the publis-

hed seasonally adjusted series?

4. Take the log of the deflated earnings and the log of GNP. Perform Dickey-

Fuller tests to all three series and make the necessary transformations to

obtain stationary data. Report your findings. Plot the transformed series

and shortly discuss any noteworthy characteristics.

Save the transformed series, you will need them in Assignment 2.

3

Assignment 2: VAR models

Use the seasonally adjusted series that are appropriately transformed (by taking

logs and differences) from Assignment 1. Below PE refers to the period 1948 –

1990, PR to 1991 – recent, and PT to 1948 – recent.

1. Estimate a VAR(1) model of earnings, GNP and the unemployment rate.

Report the reduced form coefficients and comment on them. Do this both

for PE, PR and PT and comment on the differences.

2. Test for Granger causality between the series.

3. Estimate a VAR(p) model for p = 1, 2, 3, 4 and use various information

criteria to determine which lag order is most appropriate.

4. Discuss an identification scheme for the structural shocks. Use either long-

run restrictions or a Cholesky identification. Of course you can read GJ for

inspiration.

5. Plot the appropriate impulse response functions and discuss your findings.

How do they compare to GJ? Is there a difference between the three periods

PE, PR and PT ?

4

Assignment 3: Big data

Download the data set FREDQD.xls from Nestor. This is a set of 248 quarterly

series between 1959Q4 and 2018Q3. The data have been standardized to have

zero mean and unit variance. The data consist of 14 groups. The first row of the

data set contains the group to which each series belongs.

1. Use principal component analysis to extract factors from the data (Note:

omit the first series GDPC1!). How much of the total variation in the data is

explained by each factor?

2. Analyze the factor loadings (potentially it helps to look at average absolute

loadings over groups) for the first three factors. Can you give an interpreta-

tion to the first three factors?

3. Take the first series GDPC1 as your dependent variable yt and estimate the

following model

yt = α0 +

p∑ i=1

yt−iρi + k∑

j=1

ft−1,jβj + εt+1 (1)

for p = 4 and k = 0, . . . 12. Note that we use the first lag of the factors here.

According to AIC or BIC, how many factors should you include?

4. Estimate the model in (1) based on data between 1959Q4 and 2003Q3. Using

(1), construct a forecast for 2003Q4. Then, re-estimate the factors and the

model using data between 1959Q4 and 2003Q4, and construct a forecast for

2004Q1. Continue until you have a set of forecasts for the period 2003Q4-

2018Q3. Plot the forecasts and the actual values. Do the same for a model

without factors (so the AR(4) model). Compare the forecast accuracy of

both models under different loss functions.

The following question is a bonus question

5. Using the lasso as regularization technique, estimate the following model

yt = α0 +

p∑ i=1

yt−iρi + 247∑ j=1

xt−1,jγj + εt+1

again for p = 4. Use this model to forecast GDP between 2003Q4-2018Q3.

Create a grid for your penalty parameter as log(λ) = {−30,−29.7,−29.4, . . . , 0},

5

and choose the penalty parameter based on the historical forecast perfor-

mance. You can use a package to carry out the lasso estimation. Report

your findings.

6