Do you have any comment about the RStudio package “DynareR: A Seamless Integration of R and Dynare”? Have you ever used it? Recommend any package in R to DSGE models?
I just had a quick look and it seems to simply be a wrapper for the Dynare Octave routines. Thus, there is not really any gain except for having the model output in R for e.g. plotting.
My understanding is that https://gecon.r-forge.r-project.org/ is the de facto standard in R.
Thank you for your interest in DynareR package, @Fabio1. Thank you
dynare team for your efforts.
I am the author of DynareR package.
DynareR package started as a wrapper around dynare and Octave
usable in R Markdown documents on Windows only. However, based on
suggestions from its users, the package has improved as follows:
-
DynareRis platform-indepedent, it works on all the major
Operating Systems -
If
dynareandOctaveare installed in the standard location,
DynareRwill automatically do all the configurations and
prerequisites to run dynare models -
You can embed
dynarecodes inR MarkdownorQuartodocuments.
You don’t have to openOctave,dynareand back and forth. To
embeddynarecode use the format below:
```{dynare}
First line of dynare codes
Second line of dynare codes
Last line of dynare codes
```
-
DynareRallows you to run alldynaremodels that live in
particular path:run_models()will run all thedynaremodels in
the current working directory,
run_models("path/to/your/fooDirectory*")(note the * at the end)
will run all thedynaremodels inpath/to/your/fooDirectory,
whilerun_models(c("model1","model2","model3")will run models 1,
2, and 3 at once. -
DynareRis designed to create separate folder for the outputs of
each model. For example if you runrun_models("model1"), a folder
model1will created to put the outputs. -
You can run
dynarecodes in base R or file with.Rextension.
For example save yourdynarecodes in an R objectdynareCode,
then executerun_dynare(code=dynareCode,model="modelName") -
You can use
import_logfunction to readdynarelog file into R
as a list of dataframes. You can access the list using
dynare$modelName. You can further customise it in R as you wish,
for example generate tables (usingkable,flextable,huxtable
and so on) or fetch values dynamically.
Please look at the package
README, or CRAN
page for
more details. You can also download the example
files.
Thank you once again.
I realise this is an older thread, but I wanted to mention the dsge package for R. I’ve used it and have had a very positive experience it’s a useful option for anyone wanting to work with DSGE models directly in R.
It supports linear and nonlinear models, perturbation solutions up to third order, maximum likelihood and Bayesian estimation, impulse responses, forecasting, and historical shock decomposition. It also includes tools for perfect-foresight simulations, occasionally binding constraints such as the zero lower bound, optimal policy, and DSGE-VAR estimation.
A particularly useful feature is that it can import Dynare .mod files using read_dynare() and solve or estimate the models directly in R, subject to the supported syntax, without requiring Dynare, MATLAB or Octave.
Having the modelling tools and R’s data-handling and plotting capabilities together makes for a convenient workflow. I’d recommend taking a look the documentation includes examples covering the main features.