Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr....

31
Case Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic Forecasting Models ................. 2 1.2 Collecting the Macroeconomic Data ................ 3 1.3 Ordinary and Partial Autocorrelations of Reduced Set ...... 13 1.4 Vector Autoregressive (VAR) Model of Reduced Set ....... 16 1.5 Impulse Response Functions for a Fitted VAR(p) Model ..... 19 1.6 Ordinary and Partial Autocorrelations of Differenced Series ... 22 1.7 Vector Autoregressive (VAR) Model with Differenced Series . . . 23 1.8 Impulse Response Functions for VAR(p) Fit of Differenced Series 26 1

Transcript of Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr....

Page 1: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

Case Study 5: Multivariate Time Series

Dr. Kempthorne

October 9, 2013

Contents

1 VAR Models of Macro Economic Time Series 21.1 Macroeconomic Forecasting Models . . . . . . . . . . . . . . . . . 21.2 Collecting the Macroeconomic Data . . . . . . . . . . . . . . . . 31.3 Ordinary and Partial Autocorrelations of Reduced Set . . . . . . 131.4 Vector Autoregressive (VAR) Model of Reduced Set . . . . . . . 161.5 Impulse Response Functions for a Fitted VAR(p) Model . . . . . 191.6 Ordinary and Partial Autocorrelations of Differenced Series . . . 221.7 Vector Autoregressive (VAR) Model with Differenced Series . . . 231.8 Impulse Response Functions for VAR(p) Fit of Differenced Series 26

1

Page 2: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

1 VAR Models of Macro Economic Time Series

1.1 Macroeconomic Forecasting Models

In the 1980s, Robert Litterman and Christopher Sims developed importantmacroeconomic forecasting models based on vector autoregressions(VAR). Themodels use aggregate macroeconomic variables including:

• Treasury bill rate

• M1 (money supply)

• GNP deflator (inflation)

• real GNP (Gross National Product, economic output)

• real business fixed investment

• unemployment

• trade-weighted value of the dollar

• S&P-500 index (equity market valuation)

• Commodity price index.

With such models, policy makers have the potential to anticipate changesin macroeconomic conditions. Also, incorporating variables reflecting policyactions (e.g., Federal Funds Rate) helps to evaluate the potential impact ofpolicy actions.

There is an extensive literature on VAR modeling; see the citations inPfaff(2008). The papers of Litterman and Sims in the references provide a goodintroduction to the mathematiacl framework for specifying vector autoregres-sion models in a Bayesian framework. Sims, extending the model of Litterman,accommodates time-varying variances of the disturbance/innovation terms, andnon-Gaussianity of these disturbances.

The analysis in the following sections uses the R package to collect macroec-nomic time series and fit vector-autoregressive models to a reduced set of thesemacroeconomic variables.

2

Page 3: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

1.2 Collecting the Macroeconomic Data

> # 1. Load R Libraries

>

> source("fm_casestudy_0_InstallOrLoadLibraries.r")

> # Collect macro economic data from FRED database

> # Macro Variables

> #

> # UNRATE unemployment

> # FEDFUNDS Federal Funds Rate

> # TB3MS Treasury Bill Rate

> # CPIAUCSL CPI Index All Urban Customers All Items

>

> # M1SL M1

> # GDPDEF GNP deflator

> # GDP real GNP

> # GPDI real business fixed investment

>

> # TWEXBMTH Trade weighted value of dollar

> # SP500 S&P 500 Index

>

> getSymbols("UNRATE", src="FRED")

[1] "UNRATE"

> head(UNRATE)

UNRATE

1948-01-01 3.4

1948-02-01 3.8

1948-03-01 4.0

1948-04-01 3.9

1948-05-01 3.5

1948-06-01 3.6

> chartSeries(UNRATE)

3

Page 4: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

4

6

8

10

UNRATE [1948−01−01/2013−08−01]

Last 7.3

Jan 1948 Jan 1965 Jan 1980 Jan 1995 Jan 2010

4

Page 5: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> getSymbols("FEDFUNDS", src="FRED")

[1] "FEDFUNDS"

> head(FEDFUNDS)

FEDFUNDS

1954-07-01 0.80

1954-08-01 1.22

1954-09-01 1.06

1954-10-01 0.85

1954-11-01 0.83

1954-12-01 1.28

> chartSeries(FEDFUNDS)

0

5

10

15

FEDFUNDS [1954−07−01/2013−09−01]

Last 0.08

Jul 1954 Jan 1970 Jan 1985 Jan 2000 Sep 2013

5

Page 6: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> getSymbols("CPIAUCSL", src="FRED")

[1] "CPIAUCSL"

> head(CPIAUCSL)

CPIAUCSL

1947-01-01 21.48

1947-02-01 21.62

1947-03-01 22.00

1947-04-01 22.00

1947-05-01 21.95

1947-06-01 22.08

> chartSeries(CPIAUCSL)

50

100

150

200

CPIAUCSL [1947−01−01/2013−08−01]

Last 233.526

Jan 1947 Jan 1960 Jan 1975 Jan 1990 Jan 2005

6

Page 7: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> getSymbols("M1SL", src="FRED")

[1] "M1SL"

> head(M1SL)

M1SL

1959-01-01 138.9

1959-02-01 139.4

1959-03-01 139.7

1959-04-01 139.7

1959-05-01 140.7

1959-06-01 141.2

> chartSeries(M1SL)

500

1000

1500

2000

2500

M1SL [1959−01−01/2013−08−01]

Last 2552.5

Jan 1959 Jan 1970 Jan 1982 Jan 1994 Jan 2006

7

Page 8: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> getSymbols("GDPDEF", src="FRED")

[1] "GDPDEF"

> head(GDPDEF)

GDPDEF

1947-01-01 12.578

1947-04-01 12.757

1947-07-01 12.970

1947-10-01 13.289

1948-01-01 13.392

1948-04-01 13.510

> chartSeries(GDPDEF)

20

40

60

80

100

GDPDEF [1947−01−01/2013−04−01]

Last 106.259

Jan 1947 Jan 1960 Jan 1975 Jan 1990 Jan 2005

8

Page 9: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> getSymbols("GDP", src="FRED")

[1] "GDP"

> head(GDP)

GDP

1947-01-01 243.1

1947-04-01 246.3

1947-07-01 250.1

1947-10-01 260.3

1948-01-01 266.2

1948-04-01 272.9

> chartSeries(GDP)

0

5000

10000

15000

GDP [1947−01−01/2013−04−01]

Last 16661

Jan 1947 Jan 1960 Jan 1975 Jan 1990 Jan 2005

9

Page 10: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> getSymbols("TB3MS", src="FRED")

[1] "TB3MS"

> head(TB3MS)

TB3MS

1934-01-01 0.72

1934-02-01 0.62

1934-03-01 0.24

1934-04-01 0.15

1934-05-01 0.16

1934-06-01 0.15

> chartSeries(TB3MS)

0

5

10

15

TB3MS [1934−01−01/2013−09−01]

Last 0.02

Jan 1934 Jan 1950 Jan 1970 Jan 1990 Jan 2010

10

Page 11: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> getSymbols("TWEXBMTH", src="FRED")

[1] "TWEXBMTH"

> head(TWEXBMTH)

TWEXBMTH

1973-01-01 33.9689

1973-02-01 32.5799

1973-03-01 31.5849

1973-04-01 31.7681

1973-05-01 31.5727

1973-06-01 31.0864

> chartSeries(TWEXBMTH)

40

60

80

100

120

TWEXBMTH [1973−01−01/2013−10−01]

Last 101.1501

Jan 1973 Jan 1982 Jan 1990 Jan 1998 Jan 2006 Oct 2013

11

Page 12: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> # Collect index data from Yahoo

> # 1.1.1 Set start and end date for collection in YYYYMMDD (numeric) format

> date.start<-20000101

> date.end<-20130930

> # 1.1.2 Collect historical data for S&P 500 Index

> SP500 <- getYahooData("^GSPC", start=date.start, end=date.end)

> head(SP500)

Open High Low Close Volume

2000-01-03 1469.25 1478.00 1438.36 1455.22 931800000

2000-01-04 1455.22 1455.22 1397.43 1399.42 1009000000

2000-01-05 1399.42 1413.27 1377.68 1402.11 1085500000

2000-01-06 1402.11 1411.90 1392.10 1403.45 1092300000

2000-01-07 1403.45 1441.47 1400.73 1441.47 1225200000

2000-01-10 1441.47 1464.36 1441.47 1457.60 1064800000

> chartSeries(SP500[,1:5])

800

1000

1200

1400

1600

SP500

1:5

[2000−01−03/2013−09−30]

Last 1681.55

Volume (millions):3,308,630,000

02000400060008000

10000

Jan 03 2000 Jul 01 2003 Jan 03 2007 Jul 01 2010

12

Page 13: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

1.3 Ordinary and Partial Autocorrelations of Reduced Set

> # Consider focusing on 3 variables

> ymat0<-merge(UNRATE, FEDFUNDS, CPIAUCSL)

> ind.quarterly0<-1*(is.na(ymat0[,3])==FALSE)

> sum(ind.quarterly0)

[1] 800

> dim(ymat0)

[1] 801 3

> ymat00<-ymat0[which(ind.quarterly0==1),]

> head(ymat00)

UNRATE FEDFUNDS CPIAUCSL

1947-01-01 NA NA 21.48

1947-02-01 NA NA 21.62

1947-03-01 NA NA 22.00

1947-04-01 NA NA 22.00

1947-05-01 NA NA 21.95

1947-06-01 NA NA 22.08

> par(mfcol=c(3,1))

> plot(ymat00[,1],main=dimnames(ymat00)[[2]][1])

> plot(ymat00[,2],main=dimnames(ymat00)[[2]][2])

> plot(ymat00[,3],main=dimnames(ymat00)[[2]][3])

13

Page 14: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

Jan 1947 Jan 1955 Jan 1965 Jan 1975 Jan 1985 Jan 1995 Jan 2005 Aug 2013

46

8

UNRATE

Jan 1947 Jan 1955 Jan 1965 Jan 1975 Jan 1985 Jan 1995 Jan 2005 Aug 2013

05

10

FEDFUNDS

Jan 1947 Jan 1955 Jan 1965 Jan 1975 Jan 1985 Jan 1995 Jan 2005 Aug 2013

5015

0

CPIAUCSL

> # Extract window from 1960-2000

>

> ymat00.0<-window(ymat00,

+ start = as.Date("1960-01-01"),

+ end = as.Date("2000-12-31"))

> dim(ymat00.0)

[1] 492 3

> head(ymat00.0)

UNRATE FEDFUNDS CPIAUCSL

1960-01-01 5.2 3.99 29.37

1960-02-01 4.8 3.97 29.41

1960-03-01 5.4 3.84 29.41

1960-04-01 5.2 3.92 29.54

1960-05-01 5.1 3.85 29.57

1960-06-01 5.4 3.32 29.61

> acf(ymat00.0, lag.max=10)

14

Page 15: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

0 2 4 6 8 10

0.0

0.4

0.8

Lag

AC

FUNRATE

0 2 4 6 8 10

0.0

0.4

0.8

Lag

UNRA & FEDF

0 2 4 6 8 10

0.0

0.4

0.8

Lag

UNRA & CPIA

−10 −8 −6 −4 −2 0

0.0

0.4

0.8

Lag

AC

F

FEDF & UNRA

0 2 4 6 8 10

0.0

0.4

0.8

Lag

FEDFUNDS

0 2 4 6 8 10

0.0

0.4

0.8

Lag

FEDF & CPIA

−10 −8 −6 −4 −2 0

0.0

0.4

0.8

Lag

AC

F

CPIA & UNRA

−10 −8 −6 −4 −2 0

0.0

0.4

0.8

Lag

CPIA & FEDF

0 2 4 6 8 10

0.0

0.4

0.8

Lag

CPIAUCSL

> acf(ymat00.0, type="partial", lag.max=10)

15

Page 16: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

2 4 6 8 10

−0.

50.

51.

0

Lag

Par

tial A

CF

UNRATE

2 4 6 8 10

−0.

50.

51.

0

Lag

UNRA & FEDF

2 4 6 8 10

−0.

50.

51.

0

Lag

UNRA & CPIA

−10 −8 −6 −4 −2

−0.

50.

51.

0

Lag

Par

tial A

CF

FEDF & UNRA

2 4 6 8 10

−0.

50.

51.

0

Lag

FEDFUNDS

2 4 6 8 10

−0.

50.

51.

0

Lag

FEDF & CPIA

−10 −8 −6 −4 −2

−0.

50.

51.

0

Lag

Par

tial A

CF

CPIA & UNRA

−10 −8 −6 −4 −2

−0.

50.

51.

0

Lag

CPIA & FEDF

2 4 6 8 10

−0.

50.

51.

0

Lag

CPIAUCSL

1.4 Vector Autoregressive (VAR) Model of Reduced Set

> # The function VARselect() is from the package vars; see Pfaff(2008).

> # This function identifies the optimal VAR(p) order p.

> ymat00.0.VAR.const<-VARselect(ymat00.0, lag.max=12, type="const")

> # Print out the VAR order identified by different information criteria

> ymat00.0.VAR.const$selection

AIC(n) HQ(n) SC(n) FPE(n)

12 5 2 12

> # Fit the VAR model corresponding to the Schwarz Criterion (SC) which is the BIC

> ymat00.0.VAR.const.0<-VAR(ymat00.0, p=ymat00.0.VAR.const$selection[3],type="const")

> options(show.signif.stars=FALSE)

16

Page 17: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> summary(ymat00.0.VAR.const.0)

VAR Estimation Results:

=========================

Endogenous variables: UNRATE, FEDFUNDS, CPIAUCSL

Deterministic variables: const

Sample size: 490

Log Likelihood: -90.684

Roots of the characteristic polynomial:

1.002 0.9863 0.9524 0.4675 0.3314 0.08405

Call:

VAR(y = ymat00.0, p = ymat00.0.VAR.const$selection[3], type = "const")

Estimation results for equation UNRATE:

=======================================

UNRATE = UNRATE.l1 + FEDFUNDS.l1 + CPIAUCSL.l1 + UNRATE.l2 + FEDFUNDS.l2 + CPIAUCSL.l2 + const

Estimate Std. Error t value Pr(>|t|)

UNRATE.l1 0.97239 0.04593 21.171 < 2e-16

FEDFUNDS.l1 -0.02928 0.01363 -2.148 0.03222

CPIAUCSL.l1 0.01744 0.04114 0.424 0.67176

UNRATE.l2 0.01157 0.04557 0.254 0.79974

FEDFUNDS.l2 0.04348 0.01373 3.168 0.00163

CPIAUCSL.l2 -0.01777 0.04121 -0.431 0.66642

const 0.02390 0.03558 0.672 0.50212

Residual standard error: 0.177 on 483 degrees of freedom

Multiple R-Squared: 0.9865, Adjusted R-squared: 0.9864

F-statistic: 5891 on 6 and 483 DF, p-value: < 2.2e-16

Estimation results for equation FEDFUNDS:

=========================================

FEDFUNDS = UNRATE.l1 + FEDFUNDS.l1 + CPIAUCSL.l1 + UNRATE.l2 + FEDFUNDS.l2 + CPIAUCSL.l2 + const

Estimate Std. Error t value Pr(>|t|)

UNRATE.l1 -0.65364 0.14326 -4.563 6.42e-06

FEDFUNDS.l1 1.31042 0.04252 30.816 < 2e-16

CPIAUCSL.l1 0.20253 0.12832 1.578 0.1152

UNRATE.l2 0.64608 0.14213 4.546 6.93e-06

FEDFUNDS.l2 -0.33631 0.04281 -7.856 2.60e-14

CPIAUCSL.l2 -0.20311 0.12854 -1.580 0.1147

const 0.20704 0.11098 1.866 0.0627

17

Page 18: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

Residual standard error: 0.5521 on 483 degrees of freedom

Multiple R-Squared: 0.9709, Adjusted R-squared: 0.9706

F-statistic: 2689 on 6 and 483 DF, p-value: < 2.2e-16

Estimation results for equation CPIAUCSL:

=========================================

CPIAUCSL = UNRATE.l1 + FEDFUNDS.l1 + CPIAUCSL.l1 + UNRATE.l2 + FEDFUNDS.l2 + CPIAUCSL.l2 + const

Estimate Std. Error t value Pr(>|t|)

UNRATE.l1 0.0003679 0.0473065 0.008 0.9938

FEDFUNDS.l1 0.0647816 0.0140419 4.613 5.08e-06

CPIAUCSL.l1 1.3723826 0.0423743 32.387 < 2e-16

UNRATE.l2 -0.0010824 0.0469318 -0.023 0.9816

FEDFUNDS.l2 -0.0395123 0.0141368 -2.795 0.0054

CPIAUCSL.l2 -0.3713534 0.0424442 -8.749 < 2e-16

const -0.0654237 0.0366463 -1.785 0.0748

Residual standard error: 0.1823 on 483 degrees of freedom

Multiple R-Squared: 1, Adjusted R-squared: 1

F-statistic: 5.755e+06 on 6 and 483 DF, p-value: < 2.2e-16

Covariance matrix of residuals:

UNRATE FEDFUNDS CPIAUCSL

UNRATE 0.031327 -0.018662 -0.001303

FEDFUNDS -0.018662 0.304767 0.008291

CPIAUCSL -0.001303 0.008291 0.033232

Correlation matrix of residuals:

UNRATE FEDFUNDS CPIAUCSL

UNRATE 1.00000 -0.19099 -0.04038

FEDFUNDS -0.19099 1.00000 0.08239

CPIAUCSL -0.04038 0.08239 1.00000

18

Page 19: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

1.5 Impulse Response Functions for a Fitted VAR(p) Model

The impulse response function measure the impact of a unit innovation (impulse)in a given variable on all the dependent variables in the VAR model.

> plot(irf(ymat00.0.VAR.const.0, impulse="UNRATE"))

>

> # When unemployment rises:

> # the Federal Funds rate is projected to decline

> # (consistent with Federal Reserve Policy)

> #

> # the CPI decreases (lower employment results in less

> # pressure to increase consumer prices)

xy$x

UN

RAT

E

−0.

4−

0.2

0.0

0.2

xy$x

FE

DF

UN

DS

−0.

4−

0.2

0.0

0.2

xy$x

CP

IAU

CS

L

−0.

4−

0.2

0.0

0.2

0 1 2 3 4 5 6 7 8 9 10

Orthogonal Impulse Response from UNRATE

95 % Bootstrap CI, 100 runs

19

Page 20: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> plot(irf(ymat00.0.VAR.const.0, impulse="FEDFUNDS"))

>

> # When the Fed Funds rate increases:

> #

> # The Unemployment rate tends to increase;

> # so reducing the Fed Funds rate would tend to reduce unemployment

>

> # The CPI increases; increases in the Fed Funds rate are

> # associated with increase in CPI over future quarters

xy$x

UN

RAT

E

0.0

0.2

0.4

0.6

0.8

xy$x

FE

DF

UN

DS

0.0

0.2

0.4

0.6

0.8

xy$x

CP

IAU

CS

L

0.0

0.2

0.4

0.6

0.8

0 1 2 3 4 5 6 7 8 9 10

Orthogonal Impulse Response from FEDFUNDS

95 % Bootstrap CI, 100 runs

20

Page 21: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> plot(irf(ymat00.0.VAR.const.0, impulse="CPIAUCSL"))

>

> # When the CPI increases

> #

> # The Federal Funds rate tends to increase over subsequent quarters.

> # This is consistent with Federal Reserve policy of raising

> # interest rates to control for inflation.

xy$x

UN

RAT

E

0.0

0.1

0.2

0.3

xy$x

FE

DF

UN

DS

0.0

0.1

0.2

0.3

xy$x

CP

IAU

CS

L

0.0

0.1

0.2

0.3

0 1 2 3 4 5 6 7 8 9 10

Orthogonal Impulse Response from CPIAUCSL

95 % Bootstrap CI, 100 runs

21

Page 22: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

1.6 Ordinary and Partial Autocorrelations of DifferencedSeries

> ymat000.0<-na.omit(diff(ymat00.0))

> acf(ymat000.0, lag.max=10)

0 2 4 6 8 10

−0.

20.

20.

61.

0

Lag

AC

F

UNRATE

0 2 4 6 8 10

−0.

20.

20.

61.

0

Lag

UNRA & FEDF

0 2 4 6 8 10

−0.

20.

20.

61.

0

Lag

UNRA & CPIA

−10 −8 −6 −4 −2 0

−0.

20.

20.

61.

0

Lag

AC

F

FEDF & UNRA

0 2 4 6 8 10

−0.

20.

20.

61.

0

Lag

FEDFUNDS

0 2 4 6 8 10

−0.

20.

20.

61.

0

Lag

FEDF & CPIA

−10 −8 −6 −4 −2 0

−0.

20.

20.

61.

0

Lag

AC

F

CPIA & UNRA

−10 −8 −6 −4 −2 0

−0.

20.

20.

61.

0

Lag

CPIA & FEDF

0 2 4 6 8 10

−0.

20.

20.

61.

0

Lag

CPIAUCSL

> acf(ymat000.0, type="partial", lag.max=10)

22

Page 23: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

2 4 6 8 10

−0.

6−

0.2

0.2

0.6

Lag

Par

tial A

CF

UNRATE

2 4 6 8 10

−0.

6−

0.2

0.2

0.6

Lag

UNRA & FEDF

2 4 6 8 10

−0.

6−

0.2

0.2

0.6

Lag

UNRA & CPIA

−10 −8 −6 −4 −2

−0.

6−

0.2

0.2

0.6

Lag

Par

tial A

CF

FEDF & UNRA

2 4 6 8 10

−0.

6−

0.2

0.2

0.6

Lag

FEDFUNDS

2 4 6 8 10

−0.

6−

0.2

0.2

0.6

Lag

FEDF & CPIA

−10 −8 −6 −4 −2

−0.

6−

0.2

0.2

0.6

Lag

Par

tial A

CF

CPIA & UNRA

−10 −8 −6 −4 −2

−0.

6−

0.2

0.2

0.6

Lag

CPIA & FEDF

2 4 6 8 10

−0.

6−

0.2

0.2

0.6

Lag

CPIAUCSL

1.7 Vector Autoregressive (VAR) Model with DifferencedSeries

> # The function VARselect() is from the package vars; see Pfaff(2008).

> # This function identifies the optimal VAR(p) order p.

> ymat000.0.VAR.const<-VARselect(ymat000.0, lag.max=12, type="const")

> # Print out the VAR order identified by different information criteria

> ymat000.0.VAR.const$selection

AIC(n) HQ(n) SC(n) FPE(n)

12 3 3 12

> # Fit the VAR model corresponding to the Schwarz Criterion (SC) which is the BIC

> ymat000.0.VAR.const.0<-VAR(ymat000.0, p=ymat000.0.VAR.const$selection[3],type="const")

> options(show.signif.stars=FALSE)

23

Page 24: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> summary(ymat000.0.VAR.const.0)

VAR Estimation Results:

=========================

Endogenous variables: UNRATE, FEDFUNDS, CPIAUCSL

Deterministic variables: const

Sample size: 488

Log Likelihood: -69.438

Roots of the characteristic polynomial:

0.8369 0.7659 0.584 0.584 0.5755 0.5755 0.4907 0.4907 0.3088

Call:

VAR(y = ymat000.0, p = ymat000.0.VAR.const$selection[3], type = "const")

Estimation results for equation UNRATE:

=======================================

UNRATE = UNRATE.l1 + FEDFUNDS.l1 + CPIAUCSL.l1 + UNRATE.l2 + FEDFUNDS.l2 + CPIAUCSL.l2 + UNRATE.l3 + FEDFUNDS.l3 + CPIAUCSL.l3 + const

Estimate Std. Error t value Pr(>|t|)

UNRATE.l1 -0.007647 0.045642 -0.168 0.8670

FEDFUNDS.l1 -0.010946 0.014641 -0.748 0.4551

CPIAUCSL.l1 0.033734 0.040703 0.829 0.4076

UNRATE.l2 0.220669 0.044850 4.920 1.19e-06

FEDFUNDS.l2 0.016837 0.015397 1.094 0.2747

CPIAUCSL.l2 0.060812 0.044099 1.379 0.1685

UNRATE.l3 0.182936 0.045599 4.012 6.99e-05

FEDFUNDS.l3 -0.027506 0.014294 -1.924 0.0549

CPIAUCSL.l3 0.015690 0.040408 0.388 0.6980

const -0.034330 0.013372 -2.567 0.0106

Residual standard error: 0.1714 on 478 degrees of freedom

Multiple R-Squared: 0.1238, Adjusted R-squared: 0.1073

F-statistic: 7.507 on 9 and 478 DF, p-value: 2.636e-10

Estimation results for equation FEDFUNDS:

=========================================

FEDFUNDS = UNRATE.l1 + FEDFUNDS.l1 + CPIAUCSL.l1 + UNRATE.l2 + FEDFUNDS.l2 + CPIAUCSL.l2 + UNRATE.l3 + FEDFUNDS.l3 + CPIAUCSL.l3 + const

Estimate Std. Error t value Pr(>|t|)

UNRATE.l1 -0.712680 0.145160 -4.910 1.25e-06

FEDFUNDS.l1 0.371252 0.046564 7.973 1.15e-14

CPIAUCSL.l1 0.160947 0.129450 1.243 0.214364

UNRATE.l2 -0.147333 0.142641 -1.033 0.302175

FEDFUNDS.l2 -0.179049 0.048968 -3.656 0.000284

24

Page 25: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

CPIAUCSL.l2 -0.189085 0.140252 -1.348 0.178238

UNRATE.l3 -0.204277 0.145021 -1.409 0.159604

FEDFUNDS.l3 -0.069421 0.045461 -1.527 0.127407

CPIAUCSL.l3 0.046866 0.128511 0.365 0.715507

const -0.004283 0.042528 -0.101 0.919823

Residual standard error: 0.5451 on 478 degrees of freedom

Multiple R-Squared: 0.2256, Adjusted R-squared: 0.211

F-statistic: 15.47 on 9 and 478 DF, p-value: < 2.2e-16

Estimation results for equation CPIAUCSL:

=========================================

CPIAUCSL = UNRATE.l1 + FEDFUNDS.l1 + CPIAUCSL.l1 + UNRATE.l2 + FEDFUNDS.l2 + CPIAUCSL.l2 + UNRATE.l3 + FEDFUNDS.l3 + CPIAUCSL.l3 + const

Estimate Std. Error t value Pr(>|t|)

UNRATE.l1 0.007148 0.049135 0.145 0.88439

FEDFUNDS.l1 0.046389 0.015762 2.943 0.00341

CPIAUCSL.l1 0.415128 0.043818 9.474 < 2e-16

UNRATE.l2 0.010148 0.048283 0.210 0.83361

FEDFUNDS.l2 0.032147 0.016575 1.939 0.05303

CPIAUCSL.l2 0.067344 0.047474 1.419 0.15668

UNRATE.l3 -0.026752 0.049088 -0.545 0.58603

FEDFUNDS.l3 0.005058 0.015388 0.329 0.74252

CPIAUCSL.l3 0.291014 0.043500 6.690 6.26e-11

const 0.067658 0.014395 4.700 3.41e-06

Residual standard error: 0.1845 on 478 degrees of freedom

Multiple R-Squared: 0.4855, Adjusted R-squared: 0.4758

F-statistic: 50.11 on 9 and 478 DF, p-value: < 2.2e-16

Covariance matrix of residuals:

UNRATE FEDFUNDS CPIAUCSL

UNRATE 0.0293761 -0.019046 -0.0005205

FEDFUNDS -0.0190462 0.297133 0.0057060

CPIAUCSL -0.0005205 0.005706 0.0340444

Correlation matrix of residuals:

UNRATE FEDFUNDS CPIAUCSL

UNRATE 1.00000 -0.20386 -0.01646

FEDFUNDS -0.20386 1.00000 0.05673

CPIAUCSL -0.01646 0.05673 1.00000

25

Page 26: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

1.8 Impulse Response Functions for VAR(p) Fit of Differ-enced Series

> plot(irf(ymat000.0.VAR.const.0, impulse="UNRATE"))

xy$x

UN

RAT

E

−0.

2−

0.1

0.0

0.1

0.2

xy$x

FE

DF

UN

DS

−0.

2−

0.1

0.0

0.1

0.2

xy$x

CP

IAU

CS

L

−0.

2−

0.1

0.0

0.1

0.2

0 1 2 3 4 5 6 7 8 9 10

Orthogonal Impulse Response from UNRATE

95 % Bootstrap CI, 100 runs

26

Page 27: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> plot(irf(ymat000.0.VAR.const.0, impulse="FEDFUNDS"))

>

xy$x

UN

RAT

E

0.0

0.2

0.4

0.6

xy$x

FE

DF

UN

DS

0.0

0.2

0.4

0.6

xy$x

CP

IAU

CS

L

0.0

0.2

0.4

0.6

0 1 2 3 4 5 6 7 8 9 10

Orthogonal Impulse Response from FEDFUNDS

95 % Bootstrap CI, 100 runs

27

Page 28: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

> plot(irf(ymat000.0.VAR.const.0, impulse="CPIAUCSL"))

xy$x

UN

RAT

E

−0.

050.

050.

15

xy$x

FE

DF

UN

DS

−0.

050.

050.

15

xy$x

CP

IAU

CS

L

−0.

050.

050.

15

0 1 2 3 4 5 6 7 8 9 10

Orthogonal Impulse Response from CPIAUCSL

95 % Bootstrap CI, 100 runs

28

Page 29: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

Interpreting the impulse response functions for the VAR model of the differ-enced series, we note:

• When unemployment increases, the Fed Funds rate tends to decrease oversubsequent quarters, consistent with Federal Reserve policies (i.e., stimu-lating economic growth and employment with lower interest rates).

• When the Fed Funds rate increases, there is a modest increase in inflation(CPIA). This is consistent with the Fed raising rates to control inflationwhich tends to persist for several quarters (note the high 3-rd quarter lagpartial autocorrelation in CPIAUCSL).

• When inflation (CPIAUCSL) increases, unemployment tends to rise mod-estly, and the Fed Funds rate tends to increase.

29

Page 30: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

References

Bernard Pfaff (2008). VAR, SVAR and SVEC Models: Implementation WithR Package vars, Journal of Statistical Software 27(4). URL http://www.jstatsoft.org/v27/i04/.

Robert Litterman (1979). Techniques of Forecasting Using Vector Autore-gressions. Working Paper # 115, Federal Reserve Bank of Minneapolis.

Christopher Sims (1989). A Nine Variable Probabilistic Macroeconomic Fore-casting Model. Discussion Paper 14, Federal Reserve Bank of Minneapolis.

30

Page 31: Case Study 5: Multivariate Time Series · PDF fileCase Study 5: Multivariate Time Series Dr. Kempthorne October 9, 2013 Contents 1 VAR Models of Macro Economic Time Series 2 1.1 Macroeconomic

MIT OpenCourseWarehttp://ocw.mit.edu

18.S096 Topics in Mathematics with Applications in FinanceFall 2013

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.