# Dsge model using dynare

hello, I need help
the teacher asked us to follow the “practical introduction to DSGE modeling with dynare” article by Callum Jones but I’ve never used MATLAB before and the codes aren’t working neither in R (I did install the dynareR package) nor MATLAB (it keeps saying variables unidentified)
if someone can help me please

You need to provide more information. Why is the exact error message? And please provide the mod-file you are trying to run.

The full Dynare .mod file

``````var y, x, g, r, pi, a, e, z ;
varexo eps_r, eps_a, eps_e, eps_z ;
parameters beta, omega, psi, rho_pi, rho_g, rho_x, rho_a, rho_e,
sig_r, sig_z, sig_a, sig_e ;
beta = 0.99 ; rho_x = 0.0347 ; sig_a = 0.0405 ;
psi = 0.1 ; rho_g = 0.0000 ; sig_e = 0.0012 ;
omega = 0.0617 ; rho_a = 0.9470 ; sig_z = 0.0109 ;
rho_pi = 0.3597 ; rho_e = 0.9625 ; sig_r = 0.0031 ;
model (linear) ;
x = x(+1) - ( r - pi(+1) ) + ( 1 - omega ) * ( 1 - rho_a ) * a ;
pi = beta * pi(+1) + psi * x - e ;
r = r(-1) + rho_pi * pi + rho_g * g + rho_x * x + eps_r ;
x = y - omega * a ;
g = y - y(-1) + z ;
a = rho_a * a(-1) + eps_a ;
e = rho_e * e(-1) + eps_e ;
z = eps_z ;
end ;
shocks ;
var eps_a = sig_a^2 ;
var eps_e = sig_e^2 ;
var eps_z = sig_z^2 ;
var eps_r = sig_r^2 ;
end ;
stoch_simul ;
``````

i don’t know why i keep having errors since i’ve just learned about dsge modeling recently and i’m very new to coding in MATLAB.

hello, is there a solution to this I’m still stuck.

I can run your file without any issues. Did you install Dynare, add it to the file path and then run `dynare` on your file?

I did install dynare but when I wanted to add it to the file path it said file too big, could it be because I’m working on the MATLAB website and I did not install the app itself?

also, i would like to know if there is a way to do this work on RStudio since i usually code with it, if there is could you please explain how am i supposed to get results?

thank you.

We are in the process of creating a package for Matlab Online. You should in principle be able to use DynareR. But from what I can see, that requires a working configuration of Dynare + Octave.

I’ve tried with dynareR but I don’t know what exact codes I should use, I searched but there’s nothing.
could you direct me to websites that might be useful in working a dsge with R?

thank you for all your help.

Sorry, but I have no experience with that package. You should simply stick to Matlab/Octave. That is a lot easier. To run Dynare, you don’t need to code in Matlab. Even for the R package, Octave is underlying it.