Particle Filter for non-linear model with stochastic volatility shock

Dear all

I am conducting the research for the model with stochastic volatility shock as Born and Pfeifer (2014).
I am going to use the Bayesian method with particle filter (2nd order) to obtain estimated parameters. But there are some problems with the code. when I run 1st order, the code works well but it go with some problems when I run 2nd order. I attached code for this part, please give me some advice to overcome this problem.

I try to run the code in the website: linear_model.mod
With the dynare version: 4.5.4., the code does not work and the error is:

Warning: stochastic_solvers: using order = 1 because Hessian is equal to zero

In stochastic_solvers (line 58)
In resol (line 144)
In dynare_resolve (line 69)
In non_linear_dsge_likelihood (line 228)
In initial_estimation_checks (line 137)
In dynare_estimation_1 (line 165)
In dynare_estimation (line 105)
In linear_model (line 186)
In dynare (line 223)

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

Reference to non-existent field ‘ghxx’.

Error in non_linear_dsge_likelihood (line 294)
ReducedForm.ghxx = dr.ghxx(restrict_variables_idx,:);

Error in initial_estimation_checks (line 137)
[fval,info] =
feval(objective_function,xparam1,DynareDataset,DatasetInfo,DynareOptions,Model,EstimatedParameters,BayesInfo,BoundsInfo,DynareResults);

Error in dynare_estimation_1 (line 165)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);

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

Error in linear_model (line 186)
oo_recursive_=dynare_estimation(var_list_);

Error in dynare (line 223)
evalin(‘base’,fname) ;

For unstable version, the error is even worse

I greatly appreciate any suggestion.data_sub1.m (2.8 KB)
nonlinear_Calvo_PR_sub1.mod (10.5 KB)

  1. Dynare does not yet support estimating a full model at third order, which you would require to estimate a model with stochastic volatility.
  2. Estimation with a particle filter would require measurement error, which is the reason you get an error with your file.
  3. The mod-file from the testsuite currently does not run due to a bug in Dynare.

Dear Professor
I am trying the second order but It does not work also. “Measurement error” is something is very new for me, please let me know how to design this file. I try both version dynare 4.5.4 and unstable version, but it does not work.

I follow your paper: Policy Risk and Business Cycle (2014). But in my study I only consider the policy uncertainty arising in the monetary policy and I focus mainly on the period of Great Inflation (1965Q1-1982Q1)

The main problem I have now is I cannot run estimate to obtain parameters in the stochastic volatility shock as in Table 2 of your paper. I get stuck in the problem for a while and cannot find the way to overcome it. Professor, please help me do the same as yours but for only one stochastic shock that arise in the monetary policy shock. I need your code and instruction and the data for monetary shock (as you described in the study).

Please give me some supports to overcome this problem

Thank Professor so much

Dear Professor
I am trying the second order but It does not work also. “Measurement error” is something is very new for me, please let me know how to design this file. I try both version dynare 4.5.4 and unstable version, but it does not work.

I follow your paper: Policy Risk and Business Cycle (2014). But in my study I only consider the policy uncertainty arising in the monetary policy and I focus mainly on the period of Great Inflation (1965Q1-1982Q1)

The main problem I have now is I cannot run estimate to obtain parameters in the stochastic volatility shock as in Table 2 of your paper. I get stuck in the problem for a while and cannot find the way to overcome it. Professor, please help me do the same as yours but for only one stochastic shock that arise in the monetary policy shock. I need your code and instruction and the data for monetary shock (as you described in the study).

Please give me some supports to overcome this problem

Thank Professor so much

I really need helps your current issues
Thank Professor so much

In that paper, we did not estimate the full model. The SV processes were estimated outside of the model with the codes at

Dear Prof.jpfeifer:
I am trying to estimate the following SV process use your method in the figure,but you code only applies in the AR(1) process,whether they can be modified to estimate the following model?If so,how to modify in your original code?
MPU
Please give me some supports to overcome this problem

Thank Professor so much

Adapting the code to this is straightforward as you are only adding exogenous regressors as far as I can see.

Yeah,but the accept rate of MH step is very low,about 8%,thus how to improve the accept rate ?

You need to reduce the scale factor of the proposal density.

Thank you! Alternatively,can we firstly run an OLS to filter out those exogenous regressors and AR(1) compoment ,and then fit a standard SV model?

I find that in your monte carlo experiment,the initial value of parameter is the true value,but if we deviate from the true value,it may converge to different estimation result.

  1. You cannot easily do a two-step approach, because the model is nonlinear, i.e. there will be an effect of the SV parameters on the regression coefficients.
  2. I would be surprised if there is really convergence to a different distribution. I would rather expect that the MCMC has not converged to its ergodic distribution yet. That is why you need to do convergence checks.

Thank you!But in Ng et al. (2015) AER’s paper “measuring uncertainty”,they firstly run OLS of the mean equation ,and then the estimation for SV process is estimated by R packages “stochol” independently.So I guess the SV process is exogenous,thus they can be isolated in the mean equation.

No, the SV process is not exogenous, and you are definitely loosing efficiency if you do it in two steps. But of course you can proceed as in the Jurado et al (2015) paper and simply ignore the loss in efficiency (but note that that paper had a more complicated model due to the factor structure)

Thank you!But according to the OLS regression,the SV process obtained from the residuals is orthogonal to regressors.

What do you mean with “According to the OLS regression”?

I mean the OLS is orthogonal projection,thus the OLS residuals are orthogonal to the regressors.So if we firstly run an OLS of the mean equation in (3.2) shown in my figure above,the standard SV process obtained from the residuals is orthogonal to regressors.

AFAIK the result will be asymptotically consistent, but the OLS estimator is not efficient in this case. As you are usually dealing with finite samples, this can be problematic. Moreover, the point of the particle filter is to do full information techniques. By splitting it in two step, you are losing this characteristic. But if you are fine with this loss in efficiency, you can proceed in two steps.