initval_var {gEcon} | R Documentation |
The initval_var
function sets the initial values of the model's variables to values specified by the user. The initial values close to solution will help the nonlinear equations solver to find the solution.
initval_var(model, init_var, warnings = TRUE)
model |
an object of the |
init_var |
a named list or vector of the initial values of variables. |
warnings |
logical, should warnings be displayed? |
An object of the gecon_model
class representing the model. Generic functions such as print
and summary
allow to show model elements. The get_ss_values
function returns the steady-state (equilibrium) values of the model variables.
# 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 initial values of variables rbc <- initval_var(rbc, list(K_s = 10, C = 2, I = 0.5, Y = 2.5)) rbc <- initval_var(rbc, c(pi=0))