make_model: Make model from '.gcn' file

Description Usage Arguments Details Value Note See Also Examples

View source: R/gecon.R

Description

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.

Usage

1
make_model(filename)

Arguments

filename

the path to the .gcn file containing model formulation. The .gcn extension is optional.

Details

Cf. gEcon users' guide, chapters ‘Model description language’ and ‘Derivation of First Order Conditions’.

Value

An object of the gecon_model class representing the model. Generic functions such as print and summary allow to show the model elements.

Note

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.

See Also

load_model function to load a .model.R file created earlier.

Examples

1
2
3
4
5
6
7
# 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)

gEcon documentation built on May 2, 2019, 6:52 p.m.

Related to make_model in gEcon...