Commit 0a084c8f authored by Stéphane Adjemian's avatar Stéphane Adjemian

Cosmetic changes.

M_.endo_names and M_.exo_names are cell arrays, no need to use deblank to
remove trailing whitespaces.
parent a6549397
......@@ -138,42 +138,42 @@ for par_iter=1:size(par.pdraws,1)
end
correlation=mean(correlation,3);
nvars=size(M_.endo_names(1:M_.orig_endo_nbr,:),1);
nvars=M_.orig_endo_nbr;
for var_iter_1=1:nvars
for var_iter_2=1:nvars
if max(abs(correlation(var_iter_1,var_iter_2:nvars:end)'-oo_.PosteriorTheoreticalMoments.dsge.correlation.Mean.(deblank(M_.endo_names{var_iter_1,:})).(deblank(M_.endo_names{var_iter_2,:}))))>1e-8
if max(abs(correlation(var_iter_1,var_iter_2:nvars:end)'-oo_.PosteriorTheoreticalMoments.dsge.correlation.Mean.(M_.endo_names{var_iter_1}).(M_.endo_names{var_iter_2})))>1e-8
error('Correlations do not match')
end
end
end
covariance=mean(covariance,3);
nvars=size(M_.endo_names(1:M_.orig_endo_nbr,:),1);
nvars=M_.orig_endo_nbr;
for var_iter_1=1:nvars
for var_iter_2=var_iter_1:nvars
if max(abs(covariance(var_iter_1,var_iter_2)-oo_.PosteriorTheoreticalMoments.dsge.covariance.Mean.(deblank(M_.endo_names{var_iter_1,:})).(deblank(M_.endo_names{var_iter_2,:}))))>1e-8
if max(abs(covariance(var_iter_1,var_iter_2)-oo_.PosteriorTheoreticalMoments.dsge.covariance.Mean.(M_.endo_names{var_iter_1}).(M_.endo_names{var_iter_2})))>1e-8
error('Covariances do not match')
end
end
end
variance_decomposition=mean(variance_decomposition,3);
nvars=size(M_.endo_names(1:M_.orig_endo_nbr,:),1);
nvars=M_.orig_endo_nbr;
for var_iter_1=1:nvars
for shock_iter=1:M_.exo_nbr
if max(abs(variance_decomposition(var_iter_1,shock_iter)/100-oo_.PosteriorTheoreticalMoments.dsge.VarianceDecomposition.Mean.(deblank(M_.endo_names{var_iter_1,:})).(deblank(M_.exo_names{shock_iter,:}))))>1e-8
if max(abs(variance_decomposition(var_iter_1,shock_iter)/100-oo_.PosteriorTheoreticalMoments.dsge.VarianceDecomposition.Mean.(M_.endo_names{var_iter_1}).(M_.exo_names{shock_iter})))>1e-8
error('Variance decomposition does not match')
end
end
end
conditional_variance_decomposition=mean(conditional_variance_decomposition,4);
nvars=size(M_.endo_names(1:M_.orig_endo_nbr,:),1);
nvars=M_.orig_endo_nbr;
horizon_size=size(conditional_variance_decomposition,3);
for var_iter_1=1:nvars
for shock_iter=1:M_.exo_nbr
for horizon_iter=1:horizon_size
if max(abs(conditional_variance_decomposition(var_iter_1,horizon_iter,shock_iter)-oo_.PosteriorTheoreticalMoments.dsge.ConditionalVarianceDecomposition.Mean.(deblank(M_.endo_names{var_iter_1,:})).(deblank(M_.exo_names{shock_iter,:}))(horizon_iter)))>1e-8
if max(abs(conditional_variance_decomposition(var_iter_1,horizon_iter,shock_iter)-oo_.PosteriorTheoreticalMoments.dsge.ConditionalVarianceDecomposition.Mean.(M_.endo_names{var_iter_1}).(M_.exo_names{shock_iter})(horizon_iter)))>1e-8
error('Conditional Variance decomposition does not match')
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment