stoch_simul — computes the solution and simulates the model
stoch_simul
[( OPTION
,... )] VARIABLE_NAME
[VARIABLE_NAME
...] ;
ar = INTEGER
:
Order of autocorrelation coefficients to compute and to print (default = 5)
n
dr_algo = 0 | 1: specifies the algorithm used for computing the quadratic approximation of the decision rules:
0: uses a pure perturbation approach as in Schmitt-Grohe and Uribe (2002) (default)
1: moves the point around which the Taylor expansion is computed toward the means of the distribution as in Collard and Juillard (2001)
drop = INTEGER
:
number of points dropped at the beginning of simulation before computing the summary statistics (default = 100)
hp_filter = INTEGER
:
uses HP filter with lambda = INTEGER
before computing moments (default: no filter)
hp_ngrid = INTEGER
:
number of points in the grid for the discreet Inverse Fast Fourier Transform used in the HP filter computation. It may be necessary to increase it for highly autocorrelated processes (default = 512)
irf = INTEGER
:
number of periods on which to compute the IRFs (default = 40). Setting IRF=0, suppresses the plotting of IRF's.
relative_irf requests the computation of normalized IRFs in percentage of the standard error of each shock
linear: indicates that the original model is linear (put it rather in the MODEL command).
nocorr: doesn't print the correlation matrix (printing them is the default)
nofunctions: doesn't print the coefficients of the approximated solution (printing them is the default)
nomoments: doesn't print moments of the endogenous variables (printing them is the default)
noprint: cancel any printing. Usefull for loops.
order = 1 | 2 : order of Taylor approximation (default = 2)
periods = INTEGER
: specifies the number of periods to use in simulations. At order=1, no simulation is necessary to compute theoretical moments and IRFs. A number of periods larger than one triggers automatically option simul (default = 0).
qz_criterium = INTEGER
| DOUBLE
:
value used to split stable from unstable eigenvalues in reordering the Generalized Schur decomposition used for solving 1st order problems (default 1.000001)
replic = INTEGER
: number of simulated series used to compute the IRFs (default = 1, if order = 1, and 50 otherwise)
simul:
computes a stochastic simulation of the model for the number of periods specified in the periods statement. Uses initval values, possibly recomputed by steady, as initial values for the simulation. The simulated endogenous variables are made available to the user in a vector for each variable and in the global matrix y_
. The variables are ordered alphabeticaly in the y_
matrix (default: no simulation)
simul_seed = INTEGER
|DOUBLE
|(EXPRESSION)
:
specifies a seed for the random generator so as to obtain the same random sample at each run of the program. Otherwise a different sample is used for each run (default: seed not specified). Note that if you use an EXPRESSION rather than an INTEGER or a DOUBLE, the EXPRESSION must be in parenthesis.
all steady options (see steady)
When a list of VARIABLE_NAMEs is specified, results are displayed only for these variables.
stoch_simul computes a Taylor approximation of the decision and transition functions for the model, impulse response functions and various descriptive statistics (moments, variance decomposition, correlation and autocorrelation coefficients). For correlated shocks, the variance decomposition is computed as in the VAR literature through a Cholesky decomposition of the covariance matrix of the exogenous variables. When the shocks are correlated, the variance decomposition depends upon the order of the variables in the varexo command.
The Taylor approximation is computed around the steady state (except whith option dr_algo=1). If you know how to compute the steady state for your model, you can provide a Matlab function doing the computation instead of using the nonlinear solver. The function should be called with the name of the .mod
file followed by _steadystate
. See fs2000a_steadystate.m
in examples/fs2000
directory.
Variance decomposition, correlation, autocorrelation are only displayed for variables with positive variance. Impulse response functions are only ploted for variables with response larger than 1e-10.
Currently, the IRF's are only ploted for 12 variables. Select the ones you want to see, if your model contains more than 12 endogenous variables.
Currently, the HP filter is only available when computing theoretical moments, not for for moments of simulated variables.
The covariance matrix of the shocks is specified either with the shocks command or with the Sigma_e command.
The approximated solution of a model takes the form of a set of decision rules or transition equations expressing the current value of the endogenous variables of the model as function of the previous state of the model and shocks oberved at the beginning of the period.
stoch_simul sets several fields in global variable oo_
. The descriptive statistics are theoretical moments when no simulation is requested and otherwise represent the moments of the simulated variables.
the coefficients of the decision rules are stored in global structuredr_
. Here is the correspondance with the symbols used in the above description of the decision rules:
Decision rule coefficients
ys
: dr_.ys
. The vector rows correspond to variables in alphabetical order of the variable names.
Δ2: dr_.ghs2
. The vector rows correspond to re-ordered variables (see below).
A
: dr_.ghx
. The matrix rows correspond to re-ordered variables. The matrix columns correspond to state variables (see below).
B
: dr_.ghu
. The matrix rows correspond to re-ordered variables (see below). The matrix columns correspond to exogenous variables in alphabetical order.
C
: dr_.ghxx
. The matrix rows correspond to re-ordered variables. The matrix columns correspond to the Kronecker product of the vector of state variables (see below).
D
: dr_.ghuu
. The matrix rows correspond to re-ordered variables (see below). The matrix columns correspond to the Kronecker product of exogenous variables in alphabetical order.
E
: dr_.ghxu
. The matrix rows correspond to re-ordered variables. The matrix columns correspond to the Kronecker product of the vector of state variables (see below) by the vector of exogenous variables in alphabetical order.
When reordered, the variables are stored in the following order: static variables, purely predetermined variables (variables that appear only at the current and lagged periods in the model), variables that are both predetermined and forward-looking (variables that appear at the current, future and lagged periods in the model), purely forward-looking variables (variables that appear only at the current and future periods in the model). In each category, the variables are arranged alphabetically.
The state variables of the model are purely predetermined variables and variables that are both predetermined and forward-looking. They are ordered in that order. When there are lags on more than one period, the state variables are ordered first according to their lag: first variables from the previous period, then variables from two periods before and so on. Note also that when a variable appears in the model at a lag larger than one period, it is automatically included at all inferior lags.
The mean of the endogenous variables is available in the vector oo_.mean
. The variables are arranged in alphabetical order.
The matrix of variance-covariance of the endogenous variables in the matrix oo_.var
. The variables are arranged in alphabetical order.
The matrix of autocorrelation of the endogenous variables are made available in cell array oo_.autocorr
. The element number of the matrix in the cell array corresponds to the order of autocorrelation. The option AR
(default ar=5) specifies the number of autocorrelation matrices available.
Simulated variables, when they have been computed, are available in Matlab vectors with the same name as the endogenous variables.
Impulse responses, when they have been computed, are available in Matlab vectors witht the following naming convention VARIABLE_NAME
_shock name
.
gnp_ea
contains the effect on gnp
of a one standard deviation shock on ea
.