Errors when computing bayesian variance decomposition

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.

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]) +

Error in posterior_moments (line 84)
[density(:,1),density(:,2)] =

Error in correlation_mc_analysis (line 95)

Error in posterior_analysis>job (line 71)
oo_ =

Error in posterior_analysis (line 38)
oo_ =

Error in compute_moments_varendo (line 83)
oo_ =

Error in dynare_estimation_1 (line 818)
oo_ =

Error in dynare_estimation (line 89)

Error in est_3edy_post (line 484)

Error in dynare (line 180)
evalin(‘base’,fname) ;[/code]

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

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.

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.

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.

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.

Thanks for your kind explanation.

I have one more question about “tomorrow’s unstable version” you mentioned.
Can I download it ?

Yes, the bug has been fixed.

I think the unstable version is unavailable for mac os x users…

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

I do not understand the instructions at the bottom of
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.

The macOS snapshots are back up again.