Description Usage Arguments Details Value References Examples
View source: R/class_model_pert.R
The function solves the first order perturbation of a model in a (log-)linearised form
using Christopher Sims' gensys
solver.
1 2 3 | solve_pert(model, loglin = TRUE,
loglin_var = NULL, not_loglin_var = NULL,
tol = 1e-6, solver = "gensys")
|
model |
an object of |
loglin |
a logical value. If TRUE, all variables are selected for log-linearisation. |
loglin_var |
a vector of variables that are to be log-linearised (effective only if the |
not_loglin_var |
a vector of variables that are not to be log-linearised (overrides previous settings). |
tol |
a numeric value. Tolerance level of a solution (1e-6 by default). |
solver |
the name of the first order perturbation solver. The default solver is Christopher Sims' |
Cf. gEcon users' guide, chapter ‘Solving the model in linearised form’.
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_pert_solution
function returns computed recursive laws of motion of the model's variables.
The check_bk
function displays the eigenvalues of the system and checks the Blanchard-Kahn conditions.
Sims, Ch. A. (2002), Solving Linear Rational Expectations Models, Computational Economics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # 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
rbc <- steady_state(rbc)
# solve in log-linearised form
rbc <- solve_pert(rbc)
get_pert_solution(rbc)
# solve in linearised form
rbc <- solve_pert(rbc, loglin = FALSE)
get_pert_solution(rbc)
# solve with all variables except L_s log-linearised
rbc <- solve_pert(rbc, not_loglin_var = c("L_s"))
get_pert_solution(rbc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.