Description Usage Arguments Details Value See Also Examples
View source: R/class_model_ss.R
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.
1 2 3 | 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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.