Estimation: The forecast error variance in the multivariate Kalman filter became singular

I have learned a lot from this website thanks to Professor Jpfeifer. Now I have a new problem:

My estimation code has the following error:

initial_estimation_checks:: The forecast error variance in the multivariate Kalman filter became singular.
initial_estimation_checks:: This is often a sign of stochastic singularity, but can also sometimes happen by chance
initial_estimation_checks:: for a particular combination of parameters and data realizations.
initial_estimation_checks:: If you think the latter is the case, you should try with different initial values for the estimated parameters.

Through my attempts, I found that any selection of four observation variables code can run normally, once more than four will report an error
I checked, and it seemed to me that there was no exact linear relationship between the observed variables

I’m very upset and I don’t know what the problem is

data0920.mat (7.6 KB)
est.mod (21.4 KB)

In addition, when I select four observation variables to run the code, the mode check plot seems to have problems. I upload the picture. The plots corresponding to the shock variance and persistence parameter seems to have problems, but I don’t know what the problem is.

modecheckplots1.fig (2.8 MB)
modecheckplots2.fig (2.8 MB)
modecheckplots3.fig (598.9 KB)

I am very sorry that I have a lot of questions, and English is not my native language

An immediate issue is that you have volatility shocks in a model approximated at first order. Those shocks will drop out of the model during linearization. You can see this in the horizontal likelihood lines that indicate the variances are not identified. That may cause all your problems.

First of all thank you.
Yes, as you said I introduced uncertainty shocks into the model. So I would like to ask, how should we estimate a model that includes uncertainty shocks? Should I use SMM? I can’t find the relevant dynare code.

You can either estimate the exogenous process separately as in e.g. Born/Pfeifer (2014) and then estimate the rest of the model using SMM or GMM. Or you can try using SMM/GMM for the full model as in Basu/Bundick (2017).

Hi jpfeifer,
Thanks for your kind answer
According to your suggestion, I started to modify the code of Born/Pferfer (2014) according to my model. However, when I use dynare5.0 and above, there is “out of of memory”. But if you use dynare4.5, it works, but the results are problematic. It’s difficult for me to change the equipment. Do you have any suggestions?

What is the exact error message you are getting?

Dear Jpfeifer,

I ran it successfully with version 4.6.4, but I found that fval never improved when I used csminwel. I modified the smm_diff_function function accordingly. And my estimation code is:

    x_start=[rho_sa,eta_a,rho_a,eta_kb,rho_skb,rho_kb,eta_z,rho_sz,rho_z,chi_ccyb,chi_ltve,chi_ltvi,sigma_z_ss,sigma_a_ss,sigma_kb_ss]; %use calibration as starting point
    target=[moments_emp]; %define target moments
    %optimizer options
    H0 = 1e-2*eye(length(x_start)); %Initial Hessian 
    crit = 1e-7; %Tolerance
    nit = 1000; %Number of iterations
    %make sure Dynare does not print out stuff during runs
    options_.nocorr=1;
    options_.noprint=1;
    options_.verbosity=0;

  %  options_.qz_criterium = 1+1e-6; %required because it is empty by default, leading to a crash in k_order_pert
    [shock_mat]=generate_FGRU_shocks(estimation_replications,winsorizing_dummy);
    [fhat,xhat] = csminwel(@smm_diff_function,x_start,H0,[],crit,nit,target,estimation_replications,shock_mat(:,:,1:estimation_replications),M_,oo_,options_);

May I ask what the reason is? How to improve it ?

And I use the Born & Pfeifer(2014) code to test, I change x_start, every time the estimated result is exactly the same as x_start. In my opinion, if I set x_start differently, I should estimate the same result. Why?

Thanks

With the information you provided, it’s impossible to tell. What you describe sounds very much like you are triggering an internal error code.