I was trying to understand how Dynare’s automatic detrending engine works, so I tried to write 2 versions of a simple RBC model with stochastic growth: one where I detrended everything myself; and one using Dynare’s detrending engine.

I believe that the model and steady-state equations are correct because I get the same numerical values from the *steady* command.

But when I run an estimation with the same datafile, I get different results for the posteriors.

Could someone shed some light on why the two versions aren’t equivalent?

I’m uploading both codes and the datafile.

RBC_Growth_Detrended.zip (4.0 KB)

Thanks in advance.