Parameter simulation plot


#1

Hello everybody,

I am trying to plot several IRFs for different values of an underlying model parameter. There are two shocks in my model (technology and government spending). My code (see attached) plots the IRFs for the government spending shock correctly, however for the technology shock it only plots the IRFs for one parameter rather than for all parameters.

RBC_sensitivity.m calls RBC.mod. I would be grateful if someone could provide me an explanation (and fix) for this issue. Thanks in advance!

RBC.mod (3.3 KB)
RBC_sensitivity.m (1.0 KB)


#2

All three parameters are plotted. But the graphs are identical so you don’t see them


#3

Dear jpfeifer,

For me the graphs don’t look identical. The plotted IRF for the technology shock (RBC_sensitivity.m) looks exactly like the IRF for parameter psi=1.1 if I enter it manually in RBC.mod. Furthermore, if I change the parameters manually and call RBC.mod directly, for instance, the IRFs for psi=1.1 and psi=0.75 differ for output.
But for the government shock I definitely obtain three different IRFs as expected.


#4

This seems to be a Matlab issue. When I use

plot(x,eval(['irf_cell{i,1}.' var{1,jj},ending_cell{1,ii}]));

instead of

plots_cell{jj}={plot(x,[eval(['irf_cell{i,1}.' var{1,jj},ending_cell{1,ii}])])};

it works


#5

I am afraid, this doesn’t work for me either. I am using Matlab R2018b and dynare 4.5.7, in case this might be relevant.


#6

Could you try

RBC_sensitivity.m (1.1 KB)
RBC.mod (3.6 KB)


#7

Ah, this works! Thanks!