Hi,
I have a problem with the mod-file at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=10760
I narrowed the problem down to a problem with lyapunov_symm.m
When you try the code
load workspace_dsge_simulated_theoretical_correlation
tmp = th_autocovariances(dr,ivar,M_,options_,nodecomposition);
tmp{5,1}
with the attached mat-file, you will see that the covariance matrix at lag 5 is complex, causing the subsequent crash the user reports.
The reason is that
[vx, u] = lyapunov_symm(A,B*M_.Sigma_e*B',options_.lyapunov_fixed_point_tol,options_.qz_criterium,options_.lyapunov_complex_threshold,[],[],options_.debug);
returns an vx matrix with a big negative eigenvalue, which should never happen. However, that matrix actually solves the Lyapunov equation. It simply is not a valid covariance matrix. How should we deal with an issue like this?
Best,
Johannes