The model with state dependent conditional heteroskedasticity

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:

  1. What might be the possible reasons for this error message: “Error using chol: The matrix must be positive definite”?
  2. 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!

Without the codes it is impossible to tell. But the type of model looks very much like a model from the uncertainty literature. Generally, uncertainty shock models can only be solved at third-order for shocks to the variance have an independent effect. That would also mean you cannot estimate the model using the Kalman filter at order=1.

I have no idea if I estimate the model using the Kalman filter at order=1, I use the estimation command as the follow:

@#if NONLINEAR_KALMAN_BM
use_univariate_filters_if_singularity_is_detected = 0;
estimation(
datafile=Estimation_Indicator,xls_sheet=Estimation_Indicator_Kor_ln, % data file
mh_replic=2100, %
lik_init=2, kalman_algo=2, %
mode_compute=6, %
mh_nblocks = 20, %
mode_check,
selected_variables_only,
cova_compute =0, %
nonlinear_filter_initialization=3, %
logdata,
nodisplay,
plot_priors =0
) Y_obs PC_obs AB_obs VH_obs VF_obs UL_obs CappiC CapgAT CapCU;
@#endif

The code has been sent to you, and I would appreciate it if you could take a look at it for me