View source: R/model-specification.R
| dsge_model | R Documentation |
Constructs a linear DSGE model object from a set of equations.
Each equation is wrapped in obs(), unobs(), or state() to
indicate the role of the left-hand-side variable.
dsge_model(..., fixed = list(), start = list(), derived = NULL)
... |
Equation specifications created by |
fixed |
Named list of parameter values to hold fixed (constrained) during estimation. |
start |
Named list of starting values for free parameters. |
derived |
Optional function mapping a named list of primitive
parameter values to a named list of derived parameter values
(e.g. |
A linear DSGE model is specified as a system of equations in which variables enter linearly but parameters may enter nonlinearly.
Use lead(x) or E(x) within formulas to denote the one-period-ahead
model-consistent expectation of variable x.
The number of exogenous state variables (those with shocks) must equal the number of observed control variables.
An object of class "dsge_model" containing:
List of parsed equation objects.
List with elements observed, unobserved,
exo_state, endo_state.
Character vector of all parameter names.
Character vector of free (estimable) parameter names.
Named list of fixed parameter values.
Named list of starting values.
# Simple New Keynesian model
nk <- dsge_model(
obs(p ~ beta * lead(p) + kappa * x),
unobs(x ~ lead(x) - (r - lead(p) - g)),
obs(r ~ psi * p + u),
state(u ~ rhou * u),
state(g ~ rhog * g),
fixed = list(beta = 0.96),
start = list(kappa = 0.1, psi = 1.5, rhou = 0.7, rhog = 0.9)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.