initval_var {gEcon}R Documentation

Setting initial values of variables.

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

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

# 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))

[Package gEcon version 1.1.0 Index]