Still for the same case about I cannot set chain for variance or the coefficient bigger than 1 in the Hakkio model.
I tried to change coefficients of prior hyperparameters to see whether the problem comes from there.
By making the all the six coefficients smaller, the model can run more iterations to 48 iterations (from 32 in the initial coding) but cannot go further as improvement < crit termination.
The error message are displayed below.
I attach the mod file and the data as well.
It possible to lower to crit termination to enable the model to run?
Thank you very much for your answer.
Improvement on iteration 47 = 0.000000001
f at the beginning of new iteration, 6347.4239213651
x = 0.0006295044 0.00040519441 2.6815897e-05 -0.00040465661 0.00063034509
-9.0167244e-05 -0.00027130291 -4.0049188e-05 -0.0014191614 3.9996363e-05
Predicted improvement: 0.000000000
lambda = 1; f = 6347.4239214
Norm of dx 3.4241e-09
Improvement on iteration 48 = 0.000000000
improvement < crit termination
Error reading data after line identifier //== Number of states for state_variable ==//.
Error in MS-SBVAR MEX file.
Error using mexErrCheck (line 41)
Error encountered in: ms_sbvar_create_init_file.
Error in ms_sbvar_setup (line 432)
Error in ms_estimation (line 40)
Error in msbvar.driver (line 106)
[options_, oo_] = ms_estimation(M_, options_, oo_);
Error in dynare (line 293)
evalin('base',[fname '.driver']) ;
I was wandering around the forum and stumbled upon this post. I notice there are a lot of economic/coding problems in your msbvar.mod file. Perhaps these are the reasons your code isn’t running.
There are a lot of impact restrictions under svar_identification. Do you intend to have each variable respond to their own structural shock on impact? Wouldn’t this raise issues associated with over-identification?
You wrote markov_switching(chain=1, number_of_regimes=3, duration=2); svar(variances, chain=2); svar(coefficients, chain=1);
but do not have the second chain specified, e.g. markov_switching(chain=2, number_of_regimes=3, duration=2);.
There are no file_tag or output_file_tag options selected in ms_estimation, ms_simulation, or ms_compute_mdd. These are important based on my experience.
Why are you setting the Sims and Zha prior to coefficients_prior_hyperparameters=[0.0001 0.0001 0.0001 0.01 0.01 0.01]? Read Sims and Zha (1998, IER) for how to set the prior to monthly/quarterly data. If there is another reason for this prior setting (e.g., trying to set an uninformative prior), please ignore.
Deleted all the commands below and including ms_compute_probabilities. These commands are buggy in Dynare. It is best to code them yourself.