Page 1 of 1

errors when computing bayesian variance decomposition

PostPosted: Wed Oct 26, 2016 11:25 am
by earsmall
I have been trying to estimate a model using dynare.
It runs well until computing Bayesian IRFs but shows errors in computing Bayesian variance decomposition.

Code: Select all
Subscript indices must either be real
positive integers or logicals.

Error in kernel_density_estimate (line 82)
    xi(indx+[1 2]) = xi(indx+[1 2]) +
    [1-temp,temp]';

Error in posterior_moments (line 84)
        [density(:,1),density(:,2)] =
        kernel_density_estimate(xx,number_of_grid_points,...
       
Error in correlation_mc_analysis (line 95)
        posterior_moments(tmp,1,mh_conf_sig);
       
Error in posterior_analysis>job (line 71)
    oo_ =
    correlation_mc_analysis(SampleSize,'posterior',M_.dname,M_.fname,...
   
Error in posterior_analysis (line 38)
    oo_ =
    job(type,SampleSize,arg1,arg2,arg3,options_,M_,oo_,nvar,vartan);
   
Error in compute_moments_varendo (line 83)
                oo_ =
                posterior_analysis('correlation',var_list_(i,:),var_list_(j,:),h,options_,M_,oo_);
               
Error in dynare_estimation_1 (line 818)
            oo_ =
            compute_moments_varendo('posterior',options_,M_,oo_,var_list_);
           
Error in dynare_estimation (line 89)
    dynare_estimation_1(var_list,dname);

Error in est_3edy_post (line 484)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;



I hope to know what makes these errors.
I attached my mod-file and data.

Re: errors when computing bayesian variance decomposition

PostPosted: Wed Oct 26, 2016 9:00 pm
by jpfeifer
We are investigating the issue. The problem is that one of the parameter draws causes problem when solving the Lyapunov equation, resulting in complex values for the covariance matrix at lag 5.

Re: errors when computing bayesian variance decomposition

PostPosted: Thu Oct 27, 2016 9:48 am
by jpfeifer
We found the source of the bug. Please try again with tomorrow's unstable version. But unfortunately, that fixes the technical problem, but not the general problems with your mod-file. I guess the main issue is that you use a linear mean zero model with non-zero mean data. You must fix that.

Re: errors when computing bayesian variance decomposition

PostPosted: Fri Oct 28, 2016 3:20 pm
by earsmall
As for the main issue, each data of course has non-zero mean as your comment.
However, "prefilter=1" demean the data, so that their mean is zero.

I do not understand how to deal with this problem.

Re: errors when computing bayesian variance decomposition

PostPosted: Fri Oct 28, 2016 4:39 pm
by jpfeifer
Sorry, I missed the prefiltering. The problem with your model is that it is estimated to be very close to the instability region. This you can see with the red dots in the mode_check plots. You need to find out what the source of this is. Usually there is something in the data that requires huge persistence in the model to account for the data like a problematic mean or trend.

Re: errors when computing bayesian variance decomposition

PostPosted: Fri Oct 28, 2016 7:39 pm
by earsmall
Thanks for your kind explanation.

I have one more question about "tomorrow's unstable version" you mentioned.
Can I download it ?

Re: errors when computing bayesian variance decomposition

PostPosted: Sat Oct 29, 2016 8:49 am
by jpfeifer
Yes, the bug has been fixed.

Re: errors when computing bayesian variance decomposition

PostPosted: Sun Oct 30, 2016 9:09 am
by earsmall
I think the unstable version is unavailable for mac os x users...

Re: errors when computing bayesian variance decomposition

PostPosted: Sun Oct 30, 2016 9:47 am
by jpfeifer
There seems to be a problem on our side. It should be available, but clearly isn't. We will investigate the issue. What you can always do is build it yourself, using the instructions at the bottom of https://github.com/DynareTeam/dynare

Re: errors when computing bayesian variance decomposition

PostPosted: Mon Oct 31, 2016 2:41 pm
by earsmall
I do not understand the instructions at the bottom of https://github.com/DynareTeam/dynare.
I installed the latest unstable version for windows and it works well.
Hope to have it for mac os as well.

I appreciate your help and valuable comments.

Re: errors when computing bayesian variance decomposition

PostPosted: Sat Nov 05, 2016 7:05 am
by jpfeifer
The macOS snapshots are back up again.