Fix initialization of variables in dynare_sensitivity routine
Some of the variables are not properly initialized, grow within loops, and/or are not set in all cases. The ls2003a.mod
from the tests-folder crashes with prior_range=1
for example crashes because of this when no standard deviations are estimated, i.e. when using
estimated_params;
psi1 , gamma_pdf,1.5,0.5;
psi2 , gamma_pdf,0.25,0.125;
psi3 , gamma_pdf,0.25,0.125;
rho_R ,beta_pdf,0.5,0.2;
alpha ,beta_pdf,0.3,0.1;
rr ,gamma_pdf,2.5,1;
k , gamma_pdf,0.5,0.25;
tau ,gamma_pdf,0.5,0.2;
rho_q ,beta_pdf,0.4,0.2;
rho_A ,beta_pdf,0.5,0.2;
rho_ys ,beta_pdf,0.8,0.1;
rho_pies,beta_pdf,0.7,0.15;
// stderr e_R,inv_gamma_pdf,1.2533,0.6551;
// stderr e_q,inv_gamma_pdf,2.5066,1.3103;
// stderr e_A,inv_gamma_pdf,1.2533,0.6551;
// stderr e_ys,inv_gamma_pdf,1.2533,0.6551;
// stderr e_pies,inv_gamma_pdf,1.88,0.9827;
end;
With prior_range=0
the respective field associated with estimated shocks is correctly set to an empty array and everything works.