Replication of SMM estimation from " Policy Risk and Business Cycle"

Dear colleagues and Prof. Johannes Pfeifer

My name is Le Thanh Ha. I am conducting the research related to the non-linear model with stochastic volatility shocks.

I follow the paper “Policy Risk and Business cycle” which use SMM to obtain the parameters. Here is some error I got from Matlab and actually I do now know how to fix it.

Field assignment to a non-structure array object.

Error in smm_objective_function (line 57)
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);

Error in csminwel (line 62)
	f0 = fcn(x0,varargin{:});

Error in do_SMM (line 69)
        csminwel(@smm_objective_function,par,H0,[],crit,nit,empiricalmoments,varsindex,shocks,M_,options_,oo_,wtmat); 

Please take a look and give me some suggestion. I attached code here
compute_prior_weights.m (1.6 KB)
do_SMM.m (2.6 KB)
data_first_diff_BP.mat (8.7 KB)
Model_Uncertainty_Moment1.mod (10.0 KB)
smm_objective_function.m (3.5 KB)
partransform_unbounded.m (709 Bytes)
Wtmat.m (1.9 KB)
par_definition.m (667 Bytes)

It seems there was a change in Matlab’s functionality. Try the attached file
smm_objective_function.m (3.5 KB)

Dear Professor
These code are running. But there are some questions related to interpretation of results.

  1. Which sources, I can achieve the estimated parameters from SMM. I run estimation for 7 parameters: habit information (h), monetary shock perssitence (rho_r),… I do now know I can obtain these estimated parameters.

  2. For simulation moments, where can I obtain the moments simulated from the model (as in Table 5 in your paper).

P/S: I attached the file. Please help me interpret the results from SMM estimation.
Thank you Professor so muchdo_SMM.m (2.5 KB)
par_definition.m (667 Bytes)
partransform_unbounded.m (709 Bytes)
Model_Uncertainty_Moment1.mod (10.0 KB)
Wtmat.m (1.9 KB)
smm_objective_function.m (3.5 KB)

Dear Professor
These code are running. But there are some questions related to interpretation of results.

Which sources, I can achieve the estimated parameters from SMM. I run estimation for 7 parameters: habit information (h), monetary shock perssitence (rho_r),… I do now know I can obtain these estimated parameters.

For simulation moments, where can I obtain the moments simulated from the model (as in Table 5 in your paper).

P/S: I attached the file. Please help me interpret the results from SMM estimation.
Thank you Professor so muc

I am sorry, but I cannot walk you through my codes. I think they are pretty self-explanatory. On top of that, I find your questions quite hard to follow as the English is “non-standard”

  1. What do you mean with
  1. Regarding moments, once you have estimated the model, you can use those parameters in Dynare to get simulated moments.

Dear Prof. Johannes Pfeifer

My name is Lee. I am conducting the research related to the non-linear DSGE model with stochastic volatility shocks.I follow your paper “Policy Risk and Business cycle” which use SMM.Could you please tell me how to get the “+1 -1 std error” of the estimated parameters?why they are different in your table4?Since in your code ,you do the unbounded transformation for the parameters,so the std error associated with the Hessian maxtirxr as shown in Eq. (B.18) in the Online Appendix is for unbounded parameters ,not for the original parameters?If so ,how to get the std error for the original parameters?

Thank you!I look forward to your reply!

For SMM estimation, we estimated the unbounded transformation of the parameters. Once we found the mode, we uses a separate file that uses the original (bounded) parameters from the SMM to compute the standard errors as outlined in the Appendix as you mention above.

Dear Prof. Pfeifer,

I have a question regarding these codes given above. Why are you adding ‘compute_prior_weight(theta)’ to the weighted moments’ difference?

Best,
Nurdaulet

Because we employed a penalized version of SMM that adds prior information. See the original paper for a description.

Dear Prof. Pfeifer,

I’ve just run SMM estimation at order 3 using the codes above but with a different mod file. I get an objective function value of 1.1685e+12. Does this value make any sense? Or it is irrelevant and we only have to find the minimum? I was expecting to get something around zero.

Kind regards,
Nurdaulet

No, that usually indicates numerical problems. You need to debug your code and maybe add a scaling factor.

Dear All,

I saw among the new functionalities of Dynare 5.0 that it is possible to estimate higher order models using SMM. So, it should be now possible to replicate the results of “Policy Risk and the Business Cycle” directly using Dynare.

I understand from the paper, estimation is run with a 2-step approach: 1) all shocks parameters are recovered by direct inference; 2) model deep parameters are recovered using SMM while imposing shock parameters as obtained in step one. Am I right?

Concerning step 1, what was the value assigned to deep parameters while applying the particle filter to estimate shocks parameters? In section 5.1 of the JME version of the paper, I could see Table 3 report the initial values used for the SMM step, are these values also used for step 1. Sorry if it is a silly question, but I wanted to be sure.

In general, what are the drawbacks of this two-step approach?

Many thanks in advance for your help and for the super-useful work of moderators in mantaing this forum (and Dynare itself).

My best regards! DB