Using mode_compute=6 but still having "error using chol"

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Using mode_compute=6 but still having "error using chol"

Postby Oolorin » Thu Aug 08, 2013 2:21 pm

Dear all,
I use Dynare 4.3.3 to estimate my model but even if I use MCMC and the cov matrix implied by lik_init=2, I still have:
Code: Select all
Initial value of the log posterior (or likelihood): -3583984986302561
 
==========================================================
   Change in the covariance matrix = 2.25.
   Mode improvement = 3583648927135472
   New value of jscale = 1.2389e-05
==========================================================
Error using chol
Matrix must be positive definite.

Error in gmhmaxlik (line 196)
    dd = transpose(chol(CovJump));

Error in dynare_estimation_1 (line 352)
                [xparam1,PostVar,Scale,PostMean] =
                ...

Error in dynare_estimation (line 70)
    dynare_estimation_1(var_list,dname);


I tried also mode_compute=9 but get a message about the posterior kernel optimization and also "Error using dynare_estimation_1 (line 921) Mode values are outside prior bounds. Reduce prior_trunc."
Can anyone help me please?
Please find my code and data (Smets and Wouters dataset).
thanks
J.A.
Attachments
QMM.mod
(6.96 KiB) Downloaded 91 times
Oolorin
 
Posts: 5
Joined: Thu Aug 08, 2013 1:20 pm

Re: Using mode_compute=6 but still having "error using chol"

Postby Oolorin » Mon Aug 12, 2013 1:18 pm

Hi,
I corrected a typo and attached the paper I am trying to replicate. I have still the same error message.
Please help me, it's becoming urgent!!

Thanks
JA
Attachments
j.1538-4616.2008.00180.x.pdf
article
(589.94 KiB) Downloaded 89 times
QMM.mod
code corrected
(7.03 KiB) Downloaded 91 times
Oolorin
 
Posts: 5
Joined: Thu Aug 08, 2013 1:20 pm

Re: Using mode_compute=6 but still having "error using chol"

Postby jpfeifer » Mon Aug 12, 2013 2:24 pm

Please provide the data-file.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Using mode_compute=6 but still having "error using chol"

Postby Oolorin » Mon Aug 12, 2013 2:30 pm

Hello sir,
thanks for your attention. Here is the data file.
Oolorin
 
Posts: 5
Joined: Thu Aug 08, 2013 1:20 pm

Re: Using mode_compute=6 but still having "error using chol"

Postby Oolorin » Mon Aug 12, 2013 2:31 pm

Sorry for the mistake, here it is.
Attachments
usmodel_data.xls
(196 KiB) Downloaded 78 times
Oolorin
 
Posts: 5
Joined: Thu Aug 08, 2013 1:20 pm

Re: Using mode_compute=6 but still having "error using chol"

Postby jpfeifer » Mon Aug 12, 2013 4:00 pm

It is hard to tell. There is no obvious issue with the model. My guess would be that it is really hard to find the correct mode. My only suggestion is to follow the iterative mode-finding suggested in:
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4841
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Using mode_compute=6 but still having "error using chol"

Postby Oolorin » Tue Aug 13, 2013 5:46 pm

Thanks!
I will have a look at the Gill and King paper.
Yet, I have changed my code (see attached) today and got a new error message (cf below): "Index exceeds matrix dimensions".
Code: Select all
MH: I'm computing the posterior mean and covariance... Warning: Matrix is close to singular or badly
scaled. Results may be inaccurate. RCOND =
6.916154e-20.
> In compute_mh_covariance_matrix at 74
  In marginal_density at 50
  In dynare_estimation_1 at 951
  In dynare_estimation at 70
  In QMM at 631
  In dynare at 120
Warning: Matrix is close to singular or badly
scaled. Results may be inaccurate. RCOND =
6.916154e-20.
> In marginal_density at 56
  In dynare_estimation_1 at 951
  In dynare_estimation at 70
  In QMM at 631
  In dynare at 120
 Done!
 
MH: I'm computing the posterior log marginale density (modified harmonic mean)...
Warning: Matrix is close to singular or badly
scaled. Results may be inaccurate. RCOND =
6.916154e-20.
> In marginal_density at 67
  In dynare_estimation_1 at 951
  In dynare_estimation at 70
  In QMM at 631
  In dynare at 120
MH: The support of the weighting density function is not large enough...
MH: I increase the variance of this distribution.
Warning: Matrix is close to singular or badly
scaled. Results may be inaccurate. RCOND =
9.147316e-20.
> In marginal_density at 102
  In dynare_estimation_1 at 951
  In dynare_estimation at 70
  In QMM at 631
  In dynare at 120
MH: Let me try again.
Warning: Matrix is close to singular or badly
scaled. Results may be inaccurate. RCOND =
6.422115e-20.
> In marginal_density at 108
  In dynare_estimation_1 at 951
  In dynare_estimation at 70
  In QMM at 631
  In dynare at 120
         /*several times*/
MH: There's probably a problem with the modified harmonic mean estimator.
 
 
ESTIMATION RESULTS
 
Log data density is -Inf.
 
parameters
          prior mean post. mean   conf. interval  prior     pstdev

rhoz         0.500     0.6023     0.3992   0.7544  beta      0.2000
rhob         0.500     0.6158     0.4703   0.7553  beta      0.2000
rhoi         0.500     0.7820     0.7441   0.8618  beta      0.2000
rhop         0.500     0.6992     0.4895   0.8076  beta      0.2000
rhoeta       0.500     0.3112     0.1804   0.4026  beta      0.2000
rhog         0.500     0.9547     0.9211   0.9932  beta      0.2000
rhor         0.500     0.3072     0.2090   0.3777  beta      0.2000
psinu        0.500     0.3159     0.0477   0.5991  beta      0.1000
etak         4.000     2.1750     0.8119   3.3814  norm      1.5000
h            0.500     0.0557     0.0513   0.0618  beta      0.1000
eta          0.500     0.7044     0.6716   0.7457  beta      0.1000
bb           0.500     0.4326     0.4095   0.4612  beta      0.1000
lambda       0.750     0.3458     0.2623   0.3629  beta      0.1000
lambdap      0.660     0.5186     0.4118   0.6091  beta      0.1000
gamma        0.500     0.5695     0.5573   0.5897  unif      0.2887
epsilonp      1.150     1.3426     1.3151   1.3792  norm      0.0500
rpi          1.700     3.0661     2.6012   3.5459  norm      0.3000
ry           0.125     0.0135     0.0045   0.0217  gamma     0.1000
rhos         0.750     0.7742     0.7105   0.8575  beta      0.1000
gammaz       1.250     1.2283     1.1881   1.2646  unif      0.1443
 
standard deviation of shocks
          prior mean post. mean   conf. interval  prior     pstdev

sig_z        0.150     1.0646     0.7574   1.4483  invg      0.1500
sig_b        0.150     1.5624     1.2243   1.7433  invg      0.1500
sig_i        0.150     0.7181     0.2870   1.1315  invg      0.1500
sig_p        0.150     2.9297     2.6467   3.2452  invg      0.1500
sig_eta      0.150     7.0011     6.3637   7.5131  invg      0.1500
sig_g        0.150     1.7323     1.6660   1.8568  invg      0.1500
sig_r        0.150     1.7527     1.5219   1.9990  invg      0.1500
Index exceeds matrix dimensions.

Error in DsgeSmoother (line 80)
        constant = SteadyState(bayestopt_.mfys);

Error in dynare_estimation_1 (line 984)
    [atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp]
    =
    DsgeSmoother(xparam1,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);
   
Error in dynare_estimation (line 70)
    dynare_estimation_1(var_list,dname);

Error in QMM (line 631)
dynare_estimation(var_list_);

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


I looked in the posts but I don't figure out from where it comes.
Any help would be really really appreciated!
Thanks again,
JA
Attachments
QMM.mod
(6.83 KiB) Downloaded 79 times
Oolorin
 
Posts: 5
Joined: Thu Aug 08, 2013 1:20 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests