Suggestion for selected moments

Dear Prof. Pfeifer

I am conducting the exercise for matching moment by using your code in “Risk matter: A comment” for my model. That is a non-linear DSGE with stochastic volatility shock.

The moments I want to match are: variance of output, variance of consumption relative to output, variance of labor relative to output, correlation of output and consumption, and correlation of output and labor.

. This code run but there are something I need to learn from Professor.

I computed the moment from my model but the results are weird for variance out output (too big), variance output to consumption and correlation output and consumption is 1.

Question1 :Can you suggest what are my problems and how I can fix this?

I guess the problem come from the code: get_quarterly_moment

Question 2: From the file: get_quarterly_moment, I want to get the moment from growth(e.g output growth), instead of output level how can I modify this code:
from the original code

I add these lines to comput the growth

but the error came out as
Subscript indices must either be real positive integers or logicals.

Error in get_quarterly_moments (line 85)

Error in Model_Uncertainty7 (line 424)

Error in dynare (line 223)
evalin(‘base’,fname) ;generate_FGRU_shocks.m (2.2 KB)
get_quarterly_moments.m (5.9 KB)
Model_Uncertainty6.mod (15.8 KB)
simult_FGRU.m (9.2 KB)
smm_diff_function.m (4.8 KB)

Please help me explain the procedure to run your code set. I do not know how to obtain SMM estimated parameters.

P/S: I attached my code, please take a look when Professor have time and give me some suggestion on my current issue. Thank you so much

  1. That is hard to tell. But in any case, I would recommend not following the approach in the comment to Risk matters, but rather the one used in “Policy Risk and the business cycle”. Or is there a reason you need a monthly model with a strange pruning scheme?
  2. It seems you uploaded the wrong files. There is no addition to get_quarterly_moments.m