# How to use HP cyclical component for estimation in Dynare

It is not clear to us how we should have Dynare read the HP cyclical components of non-stationary series when we have specified a stationary model which we want Dynare to estimate (using non-stationary real world data made stationary with the HP filter).

We are working on a number of stationary DSGE models. When we try to estimate the model parameters with real world data, we filter the log of the non-stationary data with the HP filter to obtain a cyclical component to use in the estimation. However, we are not sure how to have Dynare read this cyclical data.

We want to use the option ‘log-linear’ in the estimation command in an attempt to remove the heteroscedasticity in de data, and as we understand it, Dynare automatically takes logs of the data when you use the ‘log-linear’ argument. For this reason we assume that it is necessary to transform the HP cycles back out of logs before having Dynare read in the data. Following this logic we can do one of two things:

1. Let Dynare read the data as exp(HP cycle), use the argument log-linear to estimate
2. Let Dynare read the data as exp(HP cycle + steady state level), where we ‘make up’ a stationairy steady-state level (but then how?) , use the argument log-linear to estimate

However, we understand that we could also write our Dynare mod file in terms of the log of the non-stationairy data [for example for a Cobb-Douglas production function exp(y) = exp(a) * exp(k) ^ chi * exp(l) ^(1 - chi); y=log(GDP), k=log(capital stock), l=log(labor), a=log(technological progress)], and then read in the data as

1. HP cycle,
2. HP cycle + steady state level,
and, in both cases, NOT use the ‘log-linear’ argument in the estimation. For these two cases we have already taken the log before filtering the data with the HP filter.

As we understand it, both of the options above numbered 1 are incorrect. In both cases only a cycle component is used in the estimation of the model, while the model has been written in terms of a stationary level. Not only that, but there is also surely a lot of information in the level of the data, that is not then in the cyclical components?

In the case of the options numbered 2, on the other hand, we have discovered in simulation studies that some of the estimated parameter posteriors are distorted when we add a constant to the data. [simulation study: simulate the data from the stationary model, add a constand to the simulated values, and then estimate the model parameter posteriors with this transformed simulated data.] Perhaps there is one linear transformation of a HP cycle that produces the correct results, but which one?

We are convinced that this type of estimation is standard practice, and that there must be a well known (just not to us) way to introduce a HP cycle data series to Dynare for estimation. Any help to us know-nothings would be greatly appreciated.

Thanks.
-Rob Luginbuhl