2nd order approximation in dynare++ and perturbation AIM

I use dynare++ to simulate the model in Rudebusch and Swanson (2012 AEJ Macro) “the bond premium in a DSGE model with long-run real and nominal risks”. But I found that the std reported by dynare++ (2nd order approximation) are different from Swanson’s code (reported in Table2 last column, excluding std for term premium), especially for real wages. Should the two give the same answers?
Does anyone know why this happens or have the same problem?
I attached my mod file and Swanson’s mathematica code.
perturbationAIM.m (25.5 KB)
ezrsbestfit.m (28.5 KB)
ezlrexopref+.mod (5.2 KB)

Dynare and AIM should give you the same results for the same approximation order (if they are simulation-based, small differences are to be expected).
Looking at your code compared to Rudebusch/Swanson (2012), it seems they are considering the logarithm of the real wage, while you are not.

Hi jpfeifer,
Thank you very much for your reply!
According to your suggestion, I tried the logarithm of real wage, consumption, labor, etc. Their std are indeed closer to Swanson’s results than before, but they are still quite different. Do you have further suggestions on what I could try?

Are you using the same approximation order? And did you cross-check your FOCs with their Mathematica code?

Hi jpfeifer,
Yes, their mathematica code reports the 2nd order approx. std for macro variables and 3rd order approx. std for term premium, and I use the same order to get std for macro variables. And I also double checked my dynare code and the mathematica code. Unfortunately, I still cannot get the same results…