make_model {gEcon} | R Documentation |
.gcn
file
This function calls the dynamic library, parses the .gcn model file, generates a .model.R file,
and loads it into a gecon_model
class object.
make_model(filename, variant = NULL, variant_name = NULL)
filename |
the path to the .gcn file containing model formulation. The |
variant |
(optional) an integer value (0-99), selected variant |
variant_name |
(optional) an character value, variant name appended to the name of the resulting .gcn file |
Cf. gEcon users' guide, chapters ‘Model description language’ and ‘Derivation of First Order Conditions’.
An object of the gecon_model
class representing the model. Generic functions such as print
and summary
allow to show the model elements.
When the function is called, an R file with the same name as the .gcn file is created in the .gcn file directory. Additional files such as Latex documentation files or a logfile may be created when relevant options are set in the .gcn file.
load_model
function to load a .model.R
file created earlier.
# copy the example to the current working directory file.copy(from = file.path(system.file("examples", package = "gEcon"), "rbc.gcn"), to = getwd()) # make and load the model rbc <- make_model("rbc.gcn") print(rbc)