# Demean the series or not

**URL:** <https://forum.dynare.org/t/demean-the-series-or-not/11130>\
**Category:** ML/Bayesian estimation\
**Created:** [20 December 2017 01:40 UTC](https://forum.dynare.org/t/demean-the-series-or-not/11130 "2017-12-20T01:40:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [21 December 2017 08:40 UTC](https://forum.dynare.org/t/demean-the-series-or-not/11130/4 "2017-12-21T08:40:38Z")

</div>

Actually, it is a bit more complicated. With the one-sided HP filter, the mean will only be asymptotically 0. Thus, if your sample is short and depending on your view of the world, you still may want to demean. See also

> [@One-sided HP filter](https://forum.dynare.org/t/one-sided-hp-filter/3976/3):
>
> Dear Johannes, Thank you for your reply. All I did was [Ytrend, Yobs] = one\_sided\_hp\_filter\_serial(log(Y)) where Yobs gives the cyclical component. Alternatively, Yobs = 100\*(log(Y)-Ytrend) still gives the same output, which has a non-zero mean. The Matlab file came from ([ideas.repec.org/c/dge/qmrbcd/181.html](http://ideas.repec.org/c/dge/qmrbcd/181.html)) and the Eviews add-in (from their website) gives identical results. [us\_gdp1.xls](https://forum.dynare.org/uploads/default/original/2X/d/d862bdb4a6f067e6685a416820743ce8736576df.xls) (33.5 KB) [one\_sided\_hp\_filter\_kalman.m](https://forum.dynare.org/uploads/default/original/2X/0/0135597d67e5f80a3d8ac204e833ef152523a6b9.m) (5.38 KB)

---

_[View the full topic](https://forum.dynare.org/t/demean-the-series-or-not/11130)._
