initval_var: Setting initial values of variables.

Description Usage Arguments Value Examples

View source: R/class_model_var.R

Description

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.

Usage

1
initval_var(model, init_var, warnings = TRUE)

Arguments

model

an object of the gecon_model class.

init_var

a named list or vector of the initial values of variables.

warnings

logical, should warnings be displayed?

Value

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.

Examples

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

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

Related to initval_var in gEcon...