solve_pert: Solve the model in a (log-)linearised form (the first order...

Description Usage Arguments Details Value References Examples

View source: R/class_model_pert.R

Description

The function solves the first order perturbation of a model in a (log-)linearised form using Christopher Sims' gensys solver.

Usage

1
2
3
solve_pert(model, loglin = TRUE,
           loglin_var = NULL, not_loglin_var = NULL,
           tol = 1e-6, solver = "gensys")

Arguments

model

an object of gecon_model class.

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 loglin argument is set to FALSE).

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' gensys solver.

Details

Cf. gEcon users' guide, chapter ‘Solving the model in linearised form’.

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_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.

References

Sims, Ch. A. (2002), Solving Linear Rational Expectations Models, Computational Economics

Examples

 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)

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

Related to solve_pert in gEcon...