Today

Time Series

Stationarity and Weak Dependence: Review

Time Series Regression: Assumptions

Time Series Regression: Results

Inference in Regression with dependent errors

Variance estimation under autocorrelation

Modeling Residual Serial Correlation

Heteroskedasticity and Autocorrelation-Consistent inference

Practical HAC Estimation

Example: Monetary Policy Reaction Function (Code)

#Library to download data
library(pdfetch)
#Download quarterly series from FRED
gdppot<-pdfetch_FRED("GDPPOT") # Potential GDP
# Downloaded quarterly fed funds rate to file 
# in directory: need this file to compile
fefr<-read.csv("Data/FEDFUNDS.csv") 
ffr<-ts(fefr[,2],start=c(1954,3),frequency=4)
Lffr<-lag(ffr)

Example: Monetary Policy Reaction Function (Code 2)

# GDP Price Deflator (price Level)
gdpdef<-pdfetch_FRED("GDPDEF") 
gdpc1<-pdfetch_FRED("GDPC1") # Real GDP
#Output Gap
gap<-ts(100*(gdpc1-gdppot)/gdppot,
      start=c(1949,2),frequency=4) 
#Inflation, # Change from 1 year ago
inf<-ts(100*(gdpdef-lag(gdpdef,4))/lag(gdpdef,4),
      start=c(1947,2),frequency=4) 
#Library for time series regression
library(dynlm)
taylorrule<-dynlm(ffr~L(ffr)+inf+gap)

Example: Monetary Policy Reaction Function (“Taylor Rule”)

taylorrule<-dynlm(ffr~L(ffr)+inf+gap)
coeftest(taylorrule,vcovHAC)

Estimates: Robust inference for Taylor Rule (Code)

library(sandwich) #Standard error estimates
library(lmtest) #Test statistics
library(stargazer) #Tables
taylorrobust<-coeftest(taylorrule,vcovHAC)
taylorprewhite<-coeftest(taylorrule,
    vcovHAC(taylorrule,prewhite=1))
stargazer(taylorrule,taylorrobust,
  taylorprewhite,type="html",header=FALSE,
  omit.stat=c("ser","adj.rsq"),
  title="Taylor Rule: Usual, HAC, 
  prewhitened HAC standard errors")                

Estimates: Robust inference for Taylor Rule

Taylor Rule: Usual, HAC, prewhitened HAC standard errors
Dependent variable:
ffr
dynamic coefficient
linear test
(1) (2) (3)
L(ffr) 0.926*** 0.926*** 0.926***
(0.023) (0.029) (0.031)
inf 0.080** 0.080 0.080
(0.036) (0.064) (0.071)
gap 0.096*** 0.096*** 0.096***
(0.023) (0.027) (0.030)
Constant 0.172* 0.172 0.172
(0.100) (0.136) (0.153)
Observations 248
R2 0.945
F Statistic 1,401.172*** (df = 3; 244)
Note: p<0.1; p<0.05; p<0.01

Sources of nonstationarity

Nonstationarity: why a big deal

Example Spurious Correlation

Marriage vs. Margarine

Marriage vs. Margarine

Dealing with nonstationary data

Trend stationarity

Making data stationary

Summary