Looping over parameters
Posted: Tue Aug 25, 2009 5:03 am
Hi All,
I am trying to see how the correlations between some variables change as some parameters change. I've been able to loop with no problems over most parameters following the suggestion in http://www.dynare.org/DynareWiki/HowtoLoops
The same loop, however, does not seem to work over standard deviation parameters. Below is an example. sigeas is the standard deviation of the shock eas.
sigeas_values = 0:.005:.01;
T1 = length(sigeas_values);
corrR1s = zeros(T1,1);
for i1 = 1:T1
sigeas = sigeas_values(i1);
stoch_simul(irf=12,nograph) r r8 r20 r40 rs r8s r20s r40s;
corrR1s(i1,1) = oo_.var(1,5) / (sqrt(oo_.var(1,1))*sqrt(oo_.var(5,5)));
end
The code does not crash, in fact it runs but reports unchanged values for the correlations which should definitely change. Is there any difference in Dynare between looping over the standard deviation parameters as opposed to any other parameters?
Many thanks,
I am trying to see how the correlations between some variables change as some parameters change. I've been able to loop with no problems over most parameters following the suggestion in http://www.dynare.org/DynareWiki/HowtoLoops
The same loop, however, does not seem to work over standard deviation parameters. Below is an example. sigeas is the standard deviation of the shock eas.
sigeas_values = 0:.005:.01;
T1 = length(sigeas_values);
corrR1s = zeros(T1,1);
for i1 = 1:T1
sigeas = sigeas_values(i1);
stoch_simul(irf=12,nograph) r r8 r20 r40 rs r8s r20s r40s;
corrR1s(i1,1) = oo_.var(1,5) / (sqrt(oo_.var(1,1))*sqrt(oo_.var(5,5)));
end
The code does not crash, in fact it runs but reports unchanged values for the correlations which should definitely change. Is there any difference in Dynare between looping over the standard deviation parameters as opposed to any other parameters?
Many thanks,