I am working with a non-linear toy RBC model with the government. I am trying to estimate the model parameters using SMM. The data moments and the model moments do not match at all—in fact, the moments are very different. The data file contains seasonally adjusted, detrended, HP-filtered data. I am attaching the code and data for your reference. Please guide through my mistakes.
Thank you for your reply.
However, I don’t understand what to do next. Would it be possible for you to elaborate on your comments? Also, please guide me on how to work with data for the SMM. I have raw data with me.
Thank you Prof. Pfeifer for your suggestion. I also appreciate your patience.
I have updated my code. However, I am still encountering some issues. Optimization problem still persists. Dynare is saying that my estimation may not be correct and hessian matrix at mode is not positive definite. This persists for all mode_compute. Additionally,
When I do not match the mean of C, Y, I, G and match variances and autocovariances and covariances, the model does a good job except for a 3-4 moments. Additionally, I do not get standard deviation for any parameter. I have worked with different mode_compute methods.
When I also try to match mean, model mean are too far from the data. Rest other are similar to previous case.
Please let me know what could be the possible cases and how to work around this. I have uploaded updated code and data. Macrodata.xlsx (13.0 KB) SMM.log (325.6 KB) SMM.mod (4.6 KB)
However, my Ph.D. chapter has a more complex model and because of high non-linearity one cannot solve steady state. Earlier, I have used fsolve to find steadystates.
In this case, I do not know how to work with SMM and still use fsolve. I am finding it difficult to call the steady state values calculated by fsolve in .m file. I have earlier tried to work with initval block.
I am requesting help with my code. (I am not feeling comfortable to share my Ph.D. chapter code here. I can send .mod and .m file on your personal email. But I assure you that the system of equations gives steady state values, as I have checked. ) I am attaching the toy model. Please let me know how to write .mod file and .m file such that I can use SMM. If possible, please suggest other alternative ways to call steady state values in the steady_state_model block.
I am working with SMM. I have estimated parameters. To estimate 15 parameters, I am using 22 moments. Is it ok to use 22 parameters? I have tried to keep those parameters that I think are informative about the parameters.
However, I have noticed that the sequence of parameters and moments is important. My estimation changes as I change the sequence of either of them. This cannot be right. Is there any way to work around this in Dynare?
Additionally, the p-value increases if I include more moments (J-stat remains more or less similar). However, shouldn’t it be the case that if I increase the number of moments and the moment does not add any information, it should be penalized and reflected in the p-value or J-statistic?
PS - This is my Ph.D. thesis chapter. Hence, I am not sure if I should send the code here.
Your question is about the number of parameters and moments seems to contain typos. The word “parameters” appears to often for the question to make sense.
The sequence of declarations should indeed not matter for the results (apart from randomness in optimization routines)
For the J-statistic and its p-value the covariance between moments is also relevant. That makes the interpretation a bit more complicated. But yes, additional moments should affect both the J-statistic and its p-value.
My apology Prof. Pfeifer. please allow me to rephrase the first paragraph.
To estimate 15 parameters, I am using 22 moments. Is it ok to use 22 moments, or should I try for fewer moments? I have tried to keep those moments that I think are informative about the parameters.
Coming to the second question, what could be a potential problem in my case where I see values of parameters/model moments depending on the sequence? Could there be any issues with the model specification or the way I have worked with the data? For the data, I took the log, removed seasonality, and then applied an HP filter to separate the trend and cycle. Next, for the model, suppose X is a variable, then I have used X_obs = log(X) - log(steady_state(X)). The cycle from the data and X_obs is used to match the moments.
Please let me know if you need more details to identify the issue.
Thank you for your kindness
With regards
Saurav Kumar