steady_state: Compute the steady state (equilibrium) of a dynamic (static)...

Description Usage Arguments Details Value See Also Examples

View source: R/class_model_ss.R

Description

The steady_state function solves for the steady state (equilibrium) of a dynamic (static) model and calibrates chosen parameters using solvers from the nleqslv package.

Usage

1
2
3
steady_state(model, solver = "nleqslv", use_jac = TRUE,
             calibration = TRUE, options_list = NULL,
             solver_status = FALSE)

Arguments

model

an object of gecon_model class.

solver

the name of non-linear equations solver. Current gEcon version provides only an interface to the nleqslv function.

use_jac

logical. If TRUE, the Jacobian matrix generated by the symbolic library is used, else numerical derivatives are computed.

calibration

logical. If FALSE, calibrating equations will not be taken into account in the computation of the steady state (equilibrium) of a dynamic (static) model. Calibrated parameters' values will be fixed then at their initial levels.

options_list

a list of chosen nleqslv solver specific settings; the following options are available:

  • method a character string with the name of the method to be used for solving non-linear system of equations. Available methods are: "Newton" and "Broyden", the default option is "Newton".

  • global a character string with the name of global search strategy to be applied. Strategies provided are: "dbldog", "pwldog", "qline", "gline", "none", the default option is "qline".

  • xscalm a character string with the name of the method for scaling initial values. It can be set to "fixed" or "auto". The default option is "fixed".

  • max_iter a numeric value, the maximal number of iterations. The default value is 150.

  • tol a numeric value setting a numeric tolerance for a solution (function value tolerance). The default value is 1e-6.

  • xtol a numeric value setting a numeric tolerance for a solution (iteration relative step length tolerance). The default value is 1e-6.

solver_status

logical. Should the solver exit code be returned?

Details

Cf. gEcon users' guide, chapter ‘Deterministic steady state & calibration’.

Value

An object of gecon_model class representing the model. Generic functions such as print and summary allow to show the model's components. The get_ss_values and get_par_values functions return steady state (equilibrium) and parameters' values, respectively.

See Also

nleqslv for the detailed description of the nleqslv solver capabilities. If the steady state has not been found, the get_residuals function can be used to check initial and final equations' residuals.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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")

# find the steady state and calibrate alpha
rbc <- initval_calibr_par(rbc, list(alpha = 0.33))
rbc <- steady_state(rbc, use_jac=TRUE,
                    options_list=list(method="Broyden", global="gline",
                                      max_iter = 300, tol = 1e-7))
get_ss_values(rbc)

# find the steady state without calibrating alpha
rbc <- initval_calibr_par(rbc, list(alpha = 0.4))
rbc <- steady_state(rbc, calibration = FALSE, use_jac = FALSE,
                    options_list = list(method = "Newton", global = "gline",
                                        max_iter = 100, tol = 1e-5))
get_ss_values(rbc)

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

Related to steady_state in gEcon...