Page 1 of 1

Plots

PostPosted: Thu Jan 15, 2015 1:11 pm
by eta
Hi, this is my deterministic model with rigid wages. I compute government purchase impact multipliers on GDP, hours worked and consumption (gmult, hmult, cmult, lines 127-129). I would like to generate the following plots:
1)Using a FOR loop, I should plot the impact multipliers as a function of the wage adjustment parameter, phi_l. The complication is that whenever I change phi_l, I also have to change the size of the discount factor shock and the value of another parameter, theta, in order to achieve a certain target. Any hint ?

2)The second plot requires putting together two models. How can I do this ?

Thanks

Re: Plots

PostPosted: Sat Jan 17, 2015 1:30 pm
by jpfeifer
1. Looping over parameters per se is discussed in http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891. To take care of parameter dependence of the type you describe, I would recommend using a steady state file. Depending on a value of phi_l, you can set the other parameters in every iteration (see the NK_baseline.mod in the Dynare examples folder. There, the labor disutility parameter is set to achieve labor in steady state to be 0.33)

2. See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5259

Re: Plots

PostPosted: Sat Jan 17, 2015 5:00 pm
by eta
The structure oo_.irfs seems to exist only for stochastic models. Mine is deterministic.

Re: Plots

PostPosted: Sat Jan 17, 2015 5:11 pm
by jpfeifer
In that case, the results are stored in
Code: Select all
oo_.endo_simul

Re: Plots

PostPosted: Sat Jan 17, 2015 5:22 pm
by eta
I'm not sure what you mean by using a steady_state file, but I have to set a shock and values of parameters so as to reproduce some targets on impact. How can I compute impact multipliers if I use values at the steady state ?

Re: Plots

PostPosted: Sat Jan 17, 2015 5:24 pm
by jpfeifer
In that case, you need a nested internal loop that solves for the endogenous parameters to hit your target.

Re: Plots

PostPosted: Thu Jan 22, 2015 10:45 am
by eta
Hi, I already have subplots for two deterministic models and I'd like to combine them. It's not clear to me what I have to write after
Code: Select all
dynare model1.mod
load('model1_results.mat', 'oo_')
transition1=oo_.endo_simul;
save transition1

dynare model2.mod
load('model2_results.mat', 'oo_')
transition2=oo_.endo_simul;
save transition2

load transition1
load transition2
figure;

Re: Plots

PostPosted: Thu Jan 22, 2015 1:01 pm
by jpfeifer
I am not sure I understand what you are trying. But you should load the files in functional forms to make sure you do not overwrite the previously loaded ones. Something like
Code: Select all
trans1=load('transition1');
trans2=load('transition2')

figure;
plot(1:length(trans1.oo_.endo_simul(:,1)),trans1.oo_.endo_simul(:,1),'b-',1:length(trans2.oo_.endo_simul(:,1)),trans2.oo_.endo_simul(:,1),'r--')

Re: Plots

PostPosted: Thu Jan 22, 2015 1:11 pm
by eta
For example, in the posted file, from line 195 you can find subplots. In another model, I have the same subplots, but with different parameters values. What is the procedure to combine them, so that I see two dynamics for each subplot ?

Re: Plots

PostPosted: Thu Jan 22, 2015 1:22 pm
by eta
The other model has a different equation, that's why I can't do the plots in the same file.

Re: Plots

PostPosted: Thu Jan 22, 2015 4:23 pm
by eta
Solved.