Page 1 of 1

bug conditional variance decomposition?

PostPosted: Mon Sep 02, 2013 3:07 pm
by ilobayesian
Dear All,
When I try to compute the conditional variance decomposition in Dynare 4.3.1, I get this error:

??? Error using ==> chol
Matrix must be positive definite.

Error in ==> conditional_variance_decomposition at 56
B =
StateSpaceModel.impulse_matrix*chol(StateSpaceModel.state_innovations_covariance_matrix)';

Error in ==> display_conditional_variance_decomposition at 49
conditional_decomposition_array =
conditional_variance_decomposition(StateSpaceModel,Steps,SubsetOfVariables );

Error in ==> disp_th_moments at 79
oo_ = display_conditional_variance_decomposition(conditional_variance_steps,...

Error in ==> stoch_simul at 151
disp_th_moments(oo_.dr,var_list);

Error in ==> finalbelmi_estim at 782
info = stoch_simul(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;


Could it be a bug?
Thanks

Re: bug conditional variance decomposition?

PostPosted: Mon Sep 02, 2013 3:15 pm
by jpfeifer
Please try the most recent version of Dynare. If the problem persists, post or send the mod-file.

Re: bug conditional variance decomposition?

PostPosted: Tue Sep 03, 2013 8:33 am
by ilobayesian
I tried the latest version, but the problem persists. I have sent you code and data.

Thank you

Re: bug conditional variance decomposition?

PostPosted: Tue Sep 03, 2013 2:28 pm
by jpfeifer
Thanks for reporting this. Please change in dynare_estimation_1.m the code
Code: Select all
M_.sigma_e_is_diagonal = 1;
if estim_params_.ncx || ~isequal(nnz(M_.Sigma_e),length(M_.Sigma_e))
    M_.sigma_e_is_diagonal = 0;
end

to
Code: Select all
M_.sigma_e_is_diagonal = 1;
if estim_params_.ncx || any(nnz(tril(M_.Sigma_e,-1)))
    M_.sigma_e_is_diagonal = 0;
end

After that, it should run. The issue is that you have one shock with variance calibrated to 0. This bugfix will be in tomorrow's unstable version.