There is a problem in the results of historical shock decomposition. I know that the sum of all shocks should be identical to the observed variables. But the results of historical shock decomposition don’t coincide with the observed ones. And the initial value is very large.

Observed variables include: the interest rate of S firm (r_s), output (y), investment (i), the ratio of debt to ouput (by). There are 46 periods in my sample.

And here is my trasformation of quarterly data:

The interest rate of S firm (r_s), output (y) and investment (i) are deflated by inflation according to the model.

Logarthimize all the observed variables.

Detrend all the variables using HP-filter.

Seasonally adjust all variables using Census X12 method.:

I have attached the data file, the mod file and the value of parameters.

Does that happen for all variables? And are you using Dynare 4.5? If not, the reason may be stochastic singularity in your model.
A couple of things regarding your data treatment:

You should deflate with the GDP deflator or the price index, not with the inflation rate (growth rate of the deflators).

You should not use the two-sided HP filter for detrending when working with state space systems.

Seasonal adjustment should be done before any other transformations.

I’m really grateful for your rapid and thorough reply. Before you replied me, According to your reply and the paper “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”, I modified the data and mod files.Then it really works well.

Dear Helen,
I also have the same problem. Do you know how to solve it? is there something wrong in data or equations in mod files?
Thank you very much.
Bowen

Dear Pfeifer,
I modified the data according to “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”. Then it really works well.
Thanks!