| dsgenl_model | R Documentation |
Constructs a nonlinear DSGE model from string-based equations.
Each equation is a character string of the form "LHS = RHS".
State equations are detected automatically when the left-hand side
is of the form VAR(+1).
dsgenl_model(
...,
observed = character(0),
unobserved = character(0),
exo_state,
endo_state = character(0),
fixed = list(),
start = list(),
ss_guess = NULL,
ss_function = NULL
)
... |
Character strings, each defining one model equation.
Use |
observed |
Character vector of observed control variable names. |
unobserved |
Character vector of unobserved control variable names.
Default is |
exo_state |
Character vector of exogenous state variable names. These have shocks attached. There must be at least as many exogenous states as observed controls (more observables than shocks would make the likelihood singular). |
endo_state |
Character vector of endogenous (predetermined) state
variable names. These have no shocks. Default is |
fixed |
Named list of parameter values to hold fixed during estimation. |
start |
Named list of starting values for free parameters. |
ss_guess |
Named numeric vector of initial guesses for steady-state
solving. If |
ss_function |
Optional function that computes the steady state analytically. Must accept a named parameter vector and return a named numeric vector of steady-state variable values. |
Equations are written in standard mathematical notation with = as
the equality sign and VAR(+1) for leads. For example:
"1/C = beta / C(+1) * (alpha * K^(alpha-1) + 1 - delta)"
State equations must have exactly one lead variable on the left-hand side
(e.g., "K(+1) = K^alpha - C + (1 - delta) * K"). Control equations
are all remaining equations.
Control equations must be provided in the order matching the controls vector (observed first, then unobserved).
An object of class "dsgenl_model".
# Simple RBC model
rbc <- dsgenl_model(
"1/C = beta / C(+1) * (alpha * exp(Z) * K^(alpha-1) + 1 - delta)",
"K(+1) = exp(Z) * K^alpha - C + (1 - delta) * K",
"Z(+1) = rho * Z",
observed = "C",
endo_state = "K",
exo_state = "Z",
fixed = list(alpha = 0.33, beta = 0.99, delta = 0.025),
start = list(rho = 0.9)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.