IRIS Toolbox Reference Manual

simulate

Simulate model

Syntax

S = simulate(M,D,Range,...)
[S,Flag,AddF,Discrep] = simulate(M,D,Range,...)

Input arguments

Output arguments

Output arguments in non-linear simulations

Options

Options for nonlinear simulations

Options for nonlinear simulations with the 'plain' solver

Options for nonlinear simulations with @fsolve or @lsqnonlin solvers

Description

Output range

Time series in the output database, S, are are defined on the simulation range, Range, plus include all necessary initial conditions, i.e. lags of variables that occur in the model code. You can use the option 'dboverlay=' to combine the output database with the input database (i.e. to include a longer history of data in the simulated series).

By default, both the input database, D, and the output database, S, are in full levels and the simulated paths for measurement variables include the effect of deterministic trends, including possibly exogenous variables. The default behavior can be changed by changing the options 'deviation=' and 'dTrends='.

The default value for 'deviation=' is false. If set to true, then the input database is expected to contain data in the form of deviations from their steady state levels or paths. For ordinary variables (i.e. variables whose log status is false), it is $x_t-\Bar x_t$, meaning that a 0 indicates that the variable is at its steady state and e.g. 2 indicates the variables exceeds its steady state by 2. For log variables (i.e. variables whose log status is true), it is $x_t/\Bar x_t$, meaning that a 1 indicates that the variable is at its steady state and e.g. 1.05 indicates that the variable is 5 per cent above its steady state.

The default value for 'dTrends=' is @auto. This means that its behavior depends on the option 'deviation='. If 'deviation=' false then deterministic trends are added to measurement variables, unless you manually override this behavior by setting 'dTrends=' false. On the other hand, if 'deviation=' true then deterministic trends are not added to measurement variables, unless you manually override this behavior by setting 'dTrends=' true.

Simulating contributions of shocks

Use the option 'contributions=' true to request the contributions of shocks to the simulated path for each variable; this option cannot be used in models with multiple alternative parameterizations or with multiple input data sets.

The output database, S, contains Ne+2 columns for each variable, where Ne is the number of shocks in the model:

The contributions are additive for ordinary variables (i.e. variables whose log status is false), and multplicative for log variables (i.e. variables whose log status is true). In other words, if S is the output database from a simulation with 'contributions=' true, X is an ordinary variable, and Z is a log variable, then

sum(S.X,2)

(i.e. the sum of all Ne+2 contributions in each period, i.e. summation goes across 2nd dimension) reproduces the final simulated path for the variable X, whereas

prod(S.Z,2)

(i.e. the product of all Ne+2 contributions) reproduces the final simulated path for the variable Z.

Simulations with multiple parameterisations and/or multiple data sets

If you simulate a model with N parameterisations and the input database contains K data sets (i.e. each variable is a time series with K columns), then the following happens:

Nonlinear simulations

In nonlinear simulations, the solver tries to find add-factors to nonlinear equations (i.e. equations with =# instead of the equal sign in the model file) in the first-order solution such that the original nonlinear equations hold for simulated trajectories (with expectations replaced with actual leads).

Two numerical approaches are available, controlled by the option 'solver=':

Example