I am trying to run a counterfactual analysis in dynare. I use a log-linear calibrated model with the following data: output (y_obs), inflation (pi_c_obs), exports (ex_obs) and imports (im_obs). Their theoretical counterparts are: y_h, pi_c_h, ex_h and im_h. The model has two shocks: eps_d (terms of trade shocks) and eps_y (foreign output shocks).
I would like to compare the results between the actual scenario, where the terms of trade shocks (eps_d) are positive from period 0 to 142, then are set to 0 from time period 143 to 181 and then are positive again, and the counterfactual scenario where the terms of trade are positive from 0 to 142 and then set to 0 from period 143 to the last period (240). Is there a way to do that in dynare or should I use matlab to perform the analysis between the factual and counterfactual scenarios ? I checked in the forum but the questions and solutions aren’t similar to mine.
You’re right thank you very much !! The thing is that now y_obs and pi_c_obs completely match but im_obs and ex_obs don’t match with the simulated data at all. I checked the output in SmoothedVariables and I can see that Smoothed.Variables.y_obs and Smoothed.Variables.pi_c_obs perfectly match the data but Smoothed.Variables.ex_obs and Smoothed.Variables.im_obs dont. I don’t understand why they dont. Model.mod (13.8 KB) makeDta.m (50 Bytes) makeDta.xlsx (78.6 KB)
Right !! I see, thank you very much for pointing this. But what should I do then ? I really need to do the analysis on at least 3 observed variables (output, inflation and exports). I know that when I estimate the model I can add measurement errors that I will estimate so that I can have as many shocks as observed variables. But in the case of calibration I am not sure what to do? Should I also use measurement errors where I fix the value of the shock?
I added a calibrated measurement error for exports and slightly changed the value of one of my parameters and now it fits. However I tried to perform a counterfactual analysis with the terms of trade shocks (epsd) fixed to 0.0025 from period 181 to the end but I think there must be a problem with my codes since the counterfactual scenario ends up behaving the exact same way for output and inflation. If you have some time to help me find my problem i would really appreciate it. Thanks a lot for your help so far !!
Sorry I wasn’t clear. Output growth and inflation have the exact same counterfactual, which makes no sense. The counterfactual scenarios are different from the data for each variables but what is weird is that output growth and inflation end up having the exact same shape and values for the counterfactual data (need to compare the counterfactual shapes and values for output growth and inflation). This makes me wonder that there must be something wrong with my codes.