Description Usage Arguments Value Examples
View source: R/class_model_par.R
The set_free_par
function allows to set values of free parameters occurring in a gecon_model
class object.
1 | set_free_par(model, free_par = NULL, reset = FALSE, warnings = TRUE)
|
model |
an object of |
free_par |
a named list or a vector of parameters. |
reset |
a logical value, if TRUE, the function allows to reset free parameters to values from the .gcn file. |
warnings |
logical, if TRUE, a warning is displayed whenever the default parameter value (specified in the .gcn file) is overwritten. |
An updated object of gecon_model
class representing the model. If the reset
option is set to TRUE,
the model's parameters will be set back to values from the .gcn file. Generic functions such as print
and summary
allow to show model elements. The get_par_values
function returns parameters' values currently in use.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # 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")
# set free parameters' values different from those in the .gcn file
rbc <- set_free_par(rbc, free_par = list(beta = 0.98, delta = 0.01))
rbc <- steady_state(rbc, options = list(method = "Broyden",
global = "gline"))
get_ss_values(rbc)
# reset values to .gcn file values
rbc <- set_free_par(rbc, reset = TRUE)
rbc <- steady_state(rbc)
get_ss_values(rbc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.