steady_state {gEcon} | R Documentation |
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.
steady_state(model, solver = "nleqslv", use_jac = TRUE, calibration = TRUE, options_list = NULL, solver_status = FALSE)
model |
an object of gecon_model class. |
solver |
the name of non-linear equations solver. Current |
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:
|
solver_status |
logical. Should the solver exit code be returned? |
Cf. gEcon users' guide, chapter ‘Deterministic steady state & calibration’.
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.
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.
# 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)