Page 1 of 1
Problem of ??? Error using ==> chol Matrix must be positive
Posted:
Sat Jun 13, 2015 2:17 pm
by dean0504
Hi Guys! I know this is a very often discussed topic here. However, I used
- Code: Select all
mode_compute=6
, the code still crashed. I am wondering could anyone help me to figure out how this problem happened? My data are detrended by HP filter. Thanks.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Sat Jun 13, 2015 3:02 pm
by jpfeifer
Please read Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models"
https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf. You are for example neglecting parameter dependence. Also, you are not supposed to use an HP-filter.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Sun Jun 14, 2015 8:01 am
by dean0504
Thanks Johannes! I fixed the dependence parameter problem. But I found that if I estimate all the parameters which are used to calculate dependence parameters, the model will crash. If I only estimate a few of them (except bet, del, alph1,aph2), the model can run. Is it because I only have 18 years' annual data? By the way, after log the observed data, why cannot I use HP filter to do the 0 zero detrend? Thanks!
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Sun Jun 14, 2015 11:42 am
by jpfeifer
Your biggest problem is that many of the parameters you try to estimate are not identified given your observables. Run the identification command to see this.
Regarding the HP filter, see the Remark on non-causal filters in the linked document.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Sat Jul 04, 2015 4:05 pm
by dean0504
Hi Johannes! My code still crashes when I run the Bayesian estimation. The information shown is as follows:
Error in computing likelihood for initial parameter values
ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: You should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):
misuse print_info (line 100)
Likelihood is a complex numberI think I fixed the identification issue and it seems there is no parameters hit the bound. The code
- Code: Select all
estimated_params_init
is included, but the code still does not work. Anything I am wrong? Please advice. Thanks!
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Mon Jul 06, 2015 3:16 pm
by jpfeifer
For some reason the Lyapunov equation for your model cannot be solved. That is, the covariance matrix of the state variables is not positive definite. Run model_diagnostics to see that there is still a problem with your setup.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Wed Jul 08, 2015 5:41 pm
by dean0504
Hi Johannes! I revised the code. Now all the parameters can be identified and the rank condition is verified. There is no further information after I used the diagnostic order. But the code still crashed. Any suggestions? Thanks in advance.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Wed Jul 08, 2015 6:34 pm
by jpfeifer
Please either provide the error message.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Wed Jul 08, 2015 10:10 pm
by dean0504
Hi, here comes the error message.
- Code: Select all
??? Error using ==> chol
Matrix must be positive definite.
Error in ==> gmhmaxlik at 197
dd = transpose(chol(CovJump));
Error in ==> dynare_estimation_1 (line 437)
[xparam1,PostVar,Scale,PostMean] = ...
Error in ==> dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in ==> Spain_estimation_notrend (line 721)
dynare_estimation(var_list_);
Error in ==> dynare (line 180)
evalin('base',fname) ;
.
Thanks in advance. This is the model I would like to use for my Phd thesis, so it is very important for me.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Thu Jul 09, 2015 6:20 am
by jpfeifer
It seems there is a problem with mode-finding. Take a look at the mode_check plots and try to understand why the mode is not at the peak of the posterior.
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Fri Jul 10, 2015 1:32 pm
by dean0504
Hi Johannes! Thanks for your help. Now the model could run. I have a question which is not related to the code, but to the result. I think most of IRFs should be very smooth with a significant trend. However, my IRFs show like waves with up and down decreasing fluctuations. Is this normal? Could this be caused by the values of parameters? Maybe this is a very general question, but I do appreciated any suggestions from you. Thanks!
Re: Problem of ??? Error using ==> chol Matrix must be posit
Posted:
Sat Jul 11, 2015 8:03 am
by jpfeifer
Oscillating IRFs are caused by complex eigenvalues. They are often due to a timing problem in the model or some very strange parameter values.