M = model(FName,...)
M = model(M,...)
FName
[ char | cellstr ] - Name(s) of model file(s) that will be loaded and converted to a new model object.
M
[ model ] - Existing model object that will be rebuilt as if from a model file.
M
[ model ] - New model object based on the input model code file or files.'assign='
[ struct | empty ] - Assign model parameters and/or steady states from this database at the time the model objects is being created.
'baseYear='
[ numeric | 2000 ] - Base year for constructing deterministic time trends.
'blazer='
[ true
| false
] - Perform block-recursive analysis of steady-state equations at the time the model object is being created; the option works only in nonlinear models.
'comment='
[ char | empty ] - Text comment attached to the model object.
'declareParameters='
[ true
| false
] - If false
, skip parameter declaration in the model file, and determine the list of parameters automatically as names found in equations but not declared.
'epsilon='
[ numeric | eps^(1/4) ] - The minimum relative step size for numerical differentiation.
'linear='
[ true
| false
] - Indicate linear models.
'makeBkw='
[ @auto
| @all
| cellstr | char ] - Variables included in the list will be made part of the vector of backward-looking variables; @auto
means the variables that do not have any lag in model equations will be put in the vector of forward-looking variables.
'multiple='
[ true | false ] - Allow each variable, shock, or parameter name to be declared (and assigned) more than once in the model file.
'optimal='
[ 'commitment'
| 'discretion'
] - Type of optimal policy calculated; only applies when the keyword min
is used in the model file.
'removeLeads='
[ true
| false
] - Remove all leads from the state-space vector, keep included only current dates and lags.
'sstateOnly='
[ true
| false
] - Read in only the steady-state versions of equations (if available).
'std='
[ numeric | 1 for linear models | 0.01 for non-linear models ] - Default standard deviation for model shocks.
'userdata='
[ ... | empty ] - Attach user data to the model object.
The model
function can be used to read in a model file named fname
, and create a model object m
based on the model file. You can then work with the model object in your own m-files, using using the IRIS model functions and standard Matlab functions.
If fname
is a cell array of more than one file names then all files are combined together in order of appearance.
The only instance where you may need to call a model function on an existing model object is to change the 'removeLeads='
option. Of course, you can always achieve the same by loading the original model file.
Read in a model code file named my.model
, and declare the model as linear:
m = model('my.model','linear',true);
Read in a model code file named my.model
, declare the model as linear, and assign some of the model parameters:
m = model('my.model','linear=',true,'assign=',P);
Note that this is equivalent to
m = model('my.model','linear=',true);
m = assign(m,P);
unless some of the parameters passed in to the model
fuction are needed to evaluate if
or !switch
expressions.