RATS 10.1
RATS 10.1

Paper Replications /

Bjornland Leitemo JME 2009

Home Page

← Previous Next →

This is a replication file for Bjørnland and Leitemo(2009). From the abstract:

 

"We estimate the interdependence between US monetary policy and the S&P500 using structural vector autoregressive(VAR) methodology. A solution is proposed to the simultaneity problem of identifying monetary and stock price shocks by using a combination of short-run and long-run restrictions that maintains the qualitative properties of a monetary policy shock found in the established literature...We find great interdependence between the interest rate setting and real stock prices. Real stock prices immediately fall by seven to nine percent due to a monetary policy shock that raises the federal funds rate by 100 basis points. A stock price shock increasing real stock prices by one percent leads to an increase in the interest rate of close to 4 basis points."

 

This uses the @ShortAndLong procedure to estimate a structural VAR on a five variable system, and includes Monte Carlo integration of the IRF's.

 

The Vector Autoregression used is a five variable system on monthly data. The series actually used have generally been substantially modified from the raw versions: stock prices are deflated by the CPI to represent real values and are included in log differences (DLRSP), log industrial production is linearly detrended (producing the series GAP), the consumer and commodity price indexes are converted to year over year inflation, with consumer price inflation further differenced (DPI). Commodity price inflation is the series COMPI2. The Federal funds rate is series INTR. The code for the transformations is from the original code provided by the authors and includes generation of a number of series which are not used in the final model. We've scaled many series up by x 100 which is needed for some of the later graphs. (The authors scaled the IRF's instead, but 100 x at the start makes more sense).

 

The following estimates the base VAR:

 

system(model=varstockp)

var gap dpi compi2 dlrsp intr

lags 1 to 4

det constant

end(system)

estimate(resids=resids) 1984:1 2002:12

compute vsigma=%sigma

 

The paper starts with Cholesky factor shocks done in two different orders. To make the results more comparable, the shocks are rescaled to have impact values of 1's on all variables. This is done by computing a factor, then doing a %DDIVIDE to divide through by the diagonal elements:

 

compute f=%decomp(vsigma)

compute f=%ddivide(f,%xdiag(f))

 

This does the first set of impulse responses in the order listed in the VAR. It accumulates the 4th variable, to produce the response of 100 log stock price rather than the rate of change. (Several other variables are in differences, but aren't being graphed at this point).

 

impulse(steps=nsteps,model=varstockp,responses=stock_first,factor=f,accum=||4||,noprint)

 

This switches the Cholesky order to put the interest rates ahead of stock prices:

 

compute f=%psdfactor(vsigma,||1,2,3,5,4||)

compute f=%ddivide(f,%xdiag(f))

impulse(steps=nsteps,model=varstockp,responses=rate_first,factor=f,accum=||4||,noprint)

 

This does the paper's Figure 1, showing the responses of the interest rate and of shock prices to the "monetary policy" (interest rate) and stock price shocks:

 

spgraph(vfields=2,hfields=2,$

  xlabels=||"Federal Funds Rate","Stock Prices"||,$

  ylabels=||"Monetary Policy Shock","Stock Price Shock"||,$

  footer=$

 "Figure 1. Impulse responses under standard Cholesky decompositions\\for two different orderings of variables")

 graph(nodates,row=1,col=1) 2

 # stock_first(5,5)

 # rate_first(5,5)

 graph(nodates,row=2,col=1) 2

 # stock_first(5,4)

 # rate_first(5,4)

 graph(nodates,row=1,col=2) 2

 # stock_first(4,5)

 # rate_first(4,5)

 graph(nodates,row=2,col=2,min=0.0) 2

 # stock_first(4,4)

 # rate_first(4,4)

spgraph(done)

 

The structural model of main interest is a combination of (mainly) short-run with the restriction that the monetary policy shock has no long-run effect on stock prices. The set up for the use of the @ShortAndLong procedure is

 

dec rect lr(5,5) sr(5,5)

input lr

. . . . .

. . . . .

. . . . .

. . . . 0

. . . . .

input sr

. 0 0 0 0

. . 0 0 0

. . . 0 0

. . . . .

. . . . .

*

@ShortAndLong(lr=lr,sr=sr,masum=inv(%varlagsums)) %sigma f

 

This is a model which is just-identified by the RRWZ criterion.

 

F is a factor of the %SIGMA matrix before normalization to unit impacts. The error decomposition cited in footnote 11 is done using this and not the normalized one (which isn't a factor):

 

errors(model=varstockp,steps=nsteps,factor=f,labels=shocklabels)

 

For graphing the IRF's, this normalizes the shocks and shows responses of all series (this was not included in the paper). This accumulates all the responses for the variables that were differenced. (Note that inflation enters the model as the difference of the inflation rate, so the accumulated response gives the response of inflation.).

 

compute f=%ddivide(f,%xdiag(f))

*

* Point estimates

*

@varirf(model=varstockp,steps=nsteps,factor=f,page=byshock,$

  shocks=shocklabels,varlabels=varlabels,accumulate=||2,3,4||)

 

The paper then computes error bands around the responses to the monetary policy and stock price shocks in the short- and long-run model. Note that the paper has an error in this as it did not recompute the lag sums when sampling the VAR coefficients—with the proper handling the error bands are a bit wider.

 

This is the "factor" function for Monte Carlo integration. This relies upon the LR and SR matrices set above. Note that it's not a true factor as it normalizes the impacts. If you want an actual factor, eliminate the final compute SRLRFactor=... instruction. This redoes the calculation of the lag sums by applying the %MODELLAGSUMS function to the simulated model.

 

function SRLRFactor sigma model

type rect SRLRFactor

type symm sigma

type model model

*

@ShortAndLong(lr=lr,sr=sr,masum=inv(%modellagsums(model))) sigma SRLRFactor

*

* This is specific to this paper.

*

compute SRLRFactor=%ddivide(SRLRFactor,%xdiag(SRLRFactor))

*

end

 

This uses @MCVARDoDraws to do Monte Carlo integration using SRLRFactor to compute the "factor" matrix given a coefficient draw.

 

@MCVARDoDraws(model=varstockp,ffunction=SRLRFactor,accum=||2,3,4||,steps=nsteps,draws=ndraws)

 

and this uses @MCProcessIRF to get the upper and lower bounds and medians for the responses so we can lay out the graph in a custom fashion.

 

@MCProcessIRF(model=varstockp,percentiles=||.16,.84||,center=median,lower=lower,upper=upper,irf=irf)

 

This does a nested SPGRAPH layout. The outer blocking has the monetary policy and stock price shocks as separate "panes". Within each are responses of the FFR (5th variable), stock prices (4th variable), inflation (2nd variable) and output gap (1st variable) arranged in a 2 x 2 grouping.

 

spgraph(vfields=2,footer=$

  "Figure 2 Impulse Responses to a Monetary Policy Shock and Stock Price Shock")

  do block=1,2

     if block==1

        compute shockcolumn=5,shockheader="Monetary Policy Shock"

     else

        compute shockcolumn=4,shockheader="Stock Price Shock"

     *

     * Set up the inner 2 x 2 graph matrix

     *

     spgraph(vfields=2,hfields=2,header=shockheader)

      graph(row=1,col=1,header=varlabels(5),nodates) 3

      # irf(5,shockcolumn)   / 1

      # lower(5,shockcolumn) / 2

      # upper(5,shockcolumn) / 2

      graph(row=1,col=2,header=varlabels(4),nodates) 3

      # irf(4,shockcolumn)   / 1

      # lower(4,shockcolumn) / 2

      # upper(4,shockcolumn) / 2

      graph(row=2,col=1,header=varlabels(2),nodates) 3

      # irf(2,shockcolumn)   / 1

      # lower(2,shockcolumn) / 2

      # upper(2,shockcolumn) / 2

      graph(row=2,col=2,header=varlabels(1),nodates) 3

      # irf(1,shockcolumn)   / 1

      # lower(1,shockcolumn) / 2

      # upper(1,shockcolumn) / 2

     spgraph(done)

  end do block

spgraph(done)

 

 

Graphs

 

 


Copyright © 2025 Thomas A. Doan