model_dynare module

Created on Wed Jan 9 16:05:56 2019 Reads a list of expanded modfile (outputtet from dynare)

@author: hanseni

class model_dynare.grap_modfile(files, save=False, savepath='', modelname='testmodel')[source]

Bases: object

Accept filenames as argument. The first file is asumed to be the main model and gives the model its name

Instead of filenames a string with a .mod file can be accepted

savepath:

(path of first file ) Where to save

save:

(True) save the frm and mod files

modelname:

(name from first model file else “testmodel” for strings), name of model

The class contains among other:

mthismodel:

The actual model

mresmodel:

A model to calculate the _res variables before the actual calculations

mparamodel:

A model to inject parameter values into a dataframe before calculation

fthismodel:

String with the model

fresmodel:

String with the model for calculating residuals

fparamodel:

String with the model for injecting parameters

modout:

String with the consolidated .mod file

creates 5 files:

{modelname}.frm:

Formulas in modelflow business language

{modelname}_res.frm:

Formulas for mresmodel

{modelname}_para.frm:

Formulas for mparamodel

{modelname}_cons.mod:

A consolidated .mod file defining the model and parameters

{modelname}.inf:

A with model information - also displayes after execution

initialize a model