by hlt215 » Sat Dec 20, 2014 10:34 pm
Hi again,
A further follow-up question about this. Instead of one loop over a parameter, I now have an additional loop over another parameter. Thus, two different loops in the same simulation. So I have:
gammas = 0.3:0.1:1;
for s = 1:length(gammas);
gamma = gammas(s);
alphas = 0.3:01:1;
for z = 1:length(alphas);
alpha = alphas(z);
stoch_simul(hp_filter = 1600, order = 1, nograph);
end;
end;
Previously, I extracted the variance by doing:
moments(:,s)=(diag(oo_.var));
How should I change the above command to account also for the other loop? I tried to do like this:
moments(:,t)=(diag(oo_.var)); where t = s*z. But I would like to put my results into a matrix of dimension s*z in which each element is the variance evaluated at a the specific pair of (s,z).