| model_latex | R Documentation |
Renders the equations of a dsge_model or dsgenl_model as
LaTeX source, suitable for pasting into a paper or writing straight to
a .tex file. Parameter names that match Greek letters are
converted automatically (beta becomes \beta), variables
receive time subscripts, and leads are wrapped in a conditional
expectation operator.
model_latex(
model,
file = NULL,
env = c("align", "gather", "none"),
numbered = TRUE,
greek = TRUE,
standalone = FALSE,
labels = FALSE
)
model |
A |
file |
Optional path to write the LaTeX source to. If
|
env |
Character. LaTeX environment to wrap the system in. One
of |
numbered |
Logical. Use the numbered environment
( |
greek |
Logical. Substitute Greek-letter parameter names with
their LaTeX commands. Default |
standalone |
Logical. Wrap the output in a minimal complete
LaTeX document (with |
labels |
Logical. Emit a |
Variables carry a time subscript: y renders as
y_{t}.
Leads render inside a conditional expectation:
lead(y) becomes \mathbb{E}_{t} y_{t+1}.
Parameter names matching a Greek letter are converted
(sigma to \sigma); a trailing _bar becomes
an overbar and a trailing _ss a steady-state superscript.
Divisions render as \frac, powers as superscripts,
and multiplication as juxtaposition.
A character vector of LaTeX source lines, returned invisibly.
When file is supplied the same lines are written there.
nk <- dsge_model(
obs(pi ~ beta * lead(pi) + kappa * x),
unobs(x ~ lead(x) - (r - lead(pi) - g)),
obs(r ~ psi * pi + u),
state(u ~ rhou * u),
state(g ~ rhog * g),
fixed = list(beta = 0.99),
start = list(kappa = 0.1, psi = 1.5, rhou = 0.7, rhog = 0.9))
tex <- model_latex(nk)
cat(head(tex, 4), sep = "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.