From d6cbc71346b07a2c64b625e2325f68ce25c34468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemia=20=28Scylla=29?= <stepan@dynare.org> Date: Wed, 6 Feb 2019 16:33:23 +0100 Subject: [PATCH] Fixes test introduced in 5a03cdeb818f8cc966291ed3387aeb7d4e3a780f. In branch 4.5, M_.endo_names is not a cell array. --- tests/moments/fs2000_post_moments.mod | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/moments/fs2000_post_moments.mod b/tests/moments/fs2000_post_moments.mod index 995b87b73e..961da37874 100644 --- a/tests/moments/fs2000_post_moments.mod +++ b/tests/moments/fs2000_post_moments.mod @@ -138,10 +138,10 @@ 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.(deblank(M_.endo_names(var_iter_1,:))).(deblank(M_.endo_names(var_iter_2,:)))))>1e-8 error('Correlations do not match') end end @@ -151,7 +151,7 @@ covariance=mean(covariance,3); nvars=size(M_.endo_names(1:M_.orig_endo_nbr,:),1); 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.(deblank(M_.endo_names(var_iter_1,:))).(deblank(M_.endo_names(var_iter_2,:)))))>1e-8 error('Covariances do not match') end end @@ -161,7 +161,7 @@ variance_decomposition=mean(variance_decomposition,3); nvars=size(M_.endo_names(1:M_.orig_endo_nbr,:),1); 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.(deblank(M_.endo_names(var_iter_1,:))).(deblank(M_.exo_names(shock_iter,:)))))>1e-8 error('Variance decomposition does not match') end end @@ -173,7 +173,7 @@ 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.(deblank(M_.endo_names(var_iter_1,:))).(deblank(M_.exo_names(shock_iter,:)))(horizon_iter)))>1e-8 error('Conditional Variance decomposition does not match') end end -- GitLab