m = model(fname,...)
m = model(m,...)
fname
[ char | cellstr ] - Name(s) of the model file(s) that will 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.'multiple='
[ true | false ] - Allow each variable, shock, or parameter name to be declared (and assigned) more than once in the model file.
'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.
'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.
'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 filenames 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.