| write_dynare | R Documentation |
Writes the model as Dynare source so that anyone can re-solve it in Dynare and compare. This is deliberate: qpmR's solver is pinned in its own tests to analytic solutions, but "does it agree with Dynare?" is the first question a modeller asks, and the answer should be cheap to check rather than something to take on trust.
write_dynare(model, file = NULL, irf = 40, order = 1, extra = NULL)
model |
A |
file |
Output path. The default |
irf |
Horizon for |
order |
Approximation order passed to |
extra |
Character vector of extra Dynare statements appended
after |
The original equations are exported, not qpmR's internal first-order
system: Dynare creates its own auxiliary variables for long leads and
lags, so the two implementations agree only if both handle them
correctly. Expectation wrappers are dropped (E(pi[+1]) becomes
pi(+1)), since leads in Dynare are already model-consistent
expectations.
The file path invisibly, or the Dynare source as a character
vector when file is NULL.
src <- write_dynare(qpm_template("bkl"), file = NULL)
cat(head(src, 15), sep = "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.