Detrending Problem

Dear Professors,

I am currently trying to replicate the fs2000 file to deepen my understanding of how the command deflator and the observation_trend block function together. Therefore, I’ve created four implementations of the same model, each implemented in a different manner (Dynare detrending or manual detrending and firstdiff data/Trended data), drawing from the example of fs2000 in the Dynare manual.

Unfortunately, I’m encountering a discrepancy in the results. Even when I fixed the same seed, the outcomes are not the same, and in others, I believe there may be errors as the discrepancies are too significant. Could someone please help me in identifying potential errors in my implementation or determining whether the deflator and observation_trend can indeed coexist.

Here the code: - Google Drive I’m unable to upload to the forum because I I included all the files created after running the code.

Thank you very much for your time and consideration.

Best regards,


The original file has a unit root with drift. I don’t really see how that is reflected in your manually detrended files. The drift seems gone.