RATS 11
RATS 11

Procedures /

DLMIRF Procedure

Home Page

← Previous Next →

@DLMIRF computes and graphs the impulse responses and error decomposition for a model in state space form. The transition equation takes the form

 

\({{\bf{Y}}_t} = {\bf{A}}{{\bf{Y}}_{t - 1}} + {\bf{F}}{{\bf{w}}_t}\)

 

where \({\bf{F}}\) is an \(n \times p\) matrix, where p is the number of fundamental shocks. The covariance matrix of \({\bf{w}}\) is assumed to be the identity. To get a different scaling for the \({\bf{w}}\), post-multiply the \({\bf{F}}\) for the state space model with a factor of the covariance matrix for \({{\bf{w}}_t}\).

 

@DLMIRF( options )  (no parameters)

Options

A=NxN matrix A (N=# of states)

F=NxP matrix F (p=# of fundamental shocks)

STEPS=# of steps [48]

 

SHOCKLABELS=VECT[STRINGS] of labels for the shocks ["shock1","shock2",...]

VARLABELS=VECT[STRING] of labels for the variables ["var1","var2",...]

 

HEADER="title for graph"

FOOTER="footer for graph"

PAGE=[ALL]/ONE/BYSHOCK/BYVARIABLE

COLUMNS=# of columns on a page [depends upon number of graphs]

The PAGE option selects the layout of a single page of graphs.

 

PAGE=ALL (the default) does all responses to all shocks on a single page (shocks in columns, dependent variables in rows). Note that the panes get a bit small when you get more than four variables.

 

PAGE=ONE does one combination of shock and variable per page.

 

PAGE=BYSHOCK does a separate page for each shock, with all responses arranged in one or more columns.

 

PAGE=BYVARIABLE does a separate page for each variable, with all shocks arranged in one or more columns.

 

ERRORS/[NOERRORS]

With ERRORS, it computes and displays the error decomposition.

 

RESULTS=RECT[SERIES] of responses

The rows are correspond to variables, the columns to shocks.

 

[GRAPH]/NOGRAPH

Use NOGRAPH to suppress the graphs.

Example

This solves a DSGE for a backwards log-linearized representation. This has just one shock (defined as a productivity shock) and has four principal endogenous variables (Y, C, K and R). The state vector also includes (at least) the productivity factor and may have others needed for the solution, but only the number included in your VARIABLES option will be included.


 

dec real beta rho mu alpha delta

dec series r c k y theta

*

frml(identity) f1 = 1 - (beta*r{-1}*c/c{-1})

frml(identity) f2 = r - (theta*alpha*k{1}^(alpha-1)+1-delta)

frml(identity) f3 = y - (theta*k{1}^alpha)

frml(identity) f4 = y - (c + k - (1-delta)*k{1})

frml           f5 = log(theta) - (rho*log(theta{1})+(1-rho)*mu)

*

group simplerbc f1 f2 f3 f4 f5

compute alpha=.3,delta=.15,rho=.9,beta=.95,mu=4.0

dsge(model=simplerbc,expand=loglin,steady=ss,a=adsge,f=fdsge) y c k r theta

*

* Compute responses to size .01 productivity shock. (If you don't

* rescale the F input matrix, the shock will be 1.0 in log form, or

* 271.8%, causing a rather dramatic response to interest rates).

*

@dlmirf(a=adsge,f=fdsge*.01,steps=40,page=byshock,$

   variables=||"Y","C","K","R"||,shocks=||"Productivity"||)


 

Sample Output


Copyright © 2025 Thomas A. Doan