The structural shock follows stationary first order autoregressive processes, driven by conditionally normally distributed heteroskedastic innovation, specifically,
The consumption lnHatvC shock follows stationary first order autoregressive processes driven by conditionally normally distributed heteroskedastic innovations:
lnHatvC = rhoC*lnHatvC(-1) + epswC %epswC N(0,Hat_hc)
The conditional variances of the consumption Hat_hc shock are loglinear functions of the past changes in and levels of the domestic and foreign output gaps:
ln(Hat_hc) = ln(HatSigmaC^2) - lamM*(psideltY*deltaln*Hat*YGf(-1) -psiY*ln(HatYGf_obs(-1))) -(1-lamM)*(psideltY*deltaln*Hat*YG(-1) -psiY*ln(HatYG_obs(-1))); % HatSigmaC N(0,HatSigmaC^2)
Here is the specific implementation form I used in Dynare:
lnHatvC = rhoC*lnHatvC(-1) + exp(lnHat_hc)
lnHat_hc = ln(HatSigmaC^2) - lamM*(psideltY*deltaln*Hat*YGf(-1) -psiY*ln(HatYGf_obs(-1))) -(1-lamM)*(psideltY*deltaln*Hat*YG(-1) -psiY*ln(HatYG_obs(-1)));
When running the model in Dynare, the following error message appears:
Error using chol: The matrix must be positive definite. (Error in gmhmaxlik_core at line 194)?
The matrix must be positive definite.error gmhmaxlik_core (line 194)
dd = transpose(chol(CovJump));
error gmhmaxlik (line 100)
[PostMode, PostVariance, Scale, PostMean] = gmhmaxlik_core(fun, OldPostMode, bounds, gmhmaxlikOptions, Scale, flag, MeanPar, OldPostVariance, varargin{:});
error dynare_minimize_objective (line 336)
[opt_par_values, hessian_mat, Scale, fval] = gmhmaxlik(objective_function, start_par_value, …
error dynare_estimation_1 (line 221)
[xparam1, fval, exitflag, hh, options_, Scale, new_rat_hess_info] =
dynare_minimize_objective(objective_function,xparam1,options_.mode_compute,options_,[bounds.lb
bounds.ub],bayestopt_.name,bayestopt_,hh,dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);
error dynare_estimation (line 118)
dynare_estimation_1(var_list,dname);
error msDSGEPF.driver (line 2017)
oo_recursive_=dynare_estimation(var_list_);
error dynare (line 278)
evalin(‘base’,[fname ‘.driver’]);
To identify the cause of the issue, I tried the following simple form, and the model runs successfully:
lnHatvC = rhoC*lnHatvC(-1) + HatSigmaC^2
**I have two questions to seek expert guidance on:
- What might be the possible reasons for this error message: “Error using chol: The matrix must be positive definite”?
- The model incorporates state-dependent conditional heteroskedasticity, where the conditional heteroskedasticity is calculated by additional equations. How should such a model be implemented in Dynare? Are there any similar examples of im
plementation in Dynare?
I would greatly appreciate any guidance from the experts. Thank you in advance!