Particle Filter for non-linear model with stochastic volatility shock


#1

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)


#2
  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.

#3

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


#4

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


#5

I really need helps your current issues
Thank Professor so much


#6

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


#7

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


#8

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


#9

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


#10

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


#11

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?


#12

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.


#13
  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.

#14

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.