fixed bugs in initialization of heteroskedastic shocks and first_obs>1 and nobs< full dimension of dataset

mr#1991
Marco Ratto 2022-01-06 14:59:33 +01:00
parent 8130125fa7
commit 8ac3f4b22b
1 changed files with 4 additions and 2 deletions

View File

@ -671,12 +671,14 @@ if options_.heteroskedastic_filter
for k=1:length(M_.heteroskedastic_shocks.Qvalue_orig)
v = M_.heteroskedastic_shocks.Qvalue_orig(k);
temp_periods=v.periods(v.periods<=options_.nobs+options_.first_obs);
temp_periods=v.periods(v.periods<options_.nobs+options_.first_obs);
temp_periods=temp_periods(temp_periods>=options_.first_obs);
M_.heteroskedastic_shocks.Qvalue(v.exo_id, temp_periods-(options_.first_obs-1)) = v.value^2;
end
for k=1:length(M_.heteroskedastic_shocks.Qscale_orig)
v = M_.heteroskedastic_shocks.Qscale_orig(k);
temp_periods=v.periods(v.periods<=options_.nobs+options_.first_obs);
temp_periods=v.periods(v.periods<options_.nobs+options_.first_obs);
temp_periods=temp_periods(temp_periods>=options_.first_obs);
M_.heteroskedastic_shocks.Qscale(v.exo_id, temp_periods-(options_.first_obs-1)) = v.scale^2;
end