# Hp\_filtered and not hp\_filtered moments: why similar means?

**URL:** https://forum.dynare.org/t/hp-filtered-and-not-hp-filtered-moments-why-similar-means/5555
**Category:** Stochastic simulations
**Created:** [1 June 2016 10:16 UTC](https://forum.dynare.org/t/hp-filtered-and-not-hp-filtered-moments-why-similar-means/5555 "2016-06-01T10:16:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dynare16](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/ad7895/32.png) [@dynare16](https://forum.dynare.org/u/dynare16)
#### Post date: [1 June 2016 10:16 UTC](https://forum.dynare.org/t/hp-filtered-and-not-hp-filtered-moments-why-similar-means/5555/1 "2016-06-01T10:16:53Z")

</div>

Hi,

I don’t understand how is the model-generated data hp-filtered with the Dynare option hp\_filter in the stoch\_simul command. When I compare any simulated DSGE model with and without hp\_filtering, I notice that the first order theoretical moments are similar for hp\_filtered theoretical moments and for not hp\_filtered theoretical moments.

However, when I hp\_filter empirical data in Matlab using the hpfilter command, the hp\_filtered empirical data does not display the same mean as the initial empirical data. I find this quite intuitive : a series with a positive time trend should display a higher mean than the cyclical component of this series.

So why do we get similar means for hp\_filtered data and not hp\_filtered data when simulating the model in Dynare ?

Any help would be much appreciated

---

<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: [1 June 2016 11:53 UTC](https://forum.dynare.org/t/hp-filtered-and-not-hp-filtered-moments-why-similar-means/5555/2 "2016-06-01T11:53:21Z")

</div>

HP-filtering will always demean the data. What Dynare reports is the mean of the unfiltered data.

---

<div class="post-metadata">

### Author: ![dynare16](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/ad7895/32.png) [@dynare16](https://forum.dynare.org/u/dynare16)
#### Post date: [1 June 2016 12:08 UTC](https://forum.dynare.org/t/hp-filtered-and-not-hp-filtered-moments-why-similar-means/5555/3 "2016-06-01T12:08:08Z")

</div>

Thank you !

---

<div class="post-metadata">

### Author: ![oper68](https://forum.dynare.org/letter_avatar_proxy/v4/letter/o/51bf81/32.png) [@oper68](https://forum.dynare.org/u/oper68)
#### Post date: [12 April 2019 15:30 UTC](https://forum.dynare.org/t/hp-filtered-and-not-hp-filtered-moments-why-similar-means/5555/4 "2019-04-12T15:30:26Z")

</div>

how do you see the moments of the filtered data, then? thanks

---

<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: [15 April 2019 12:29 UTC](https://forum.dynare.org/t/hp-filtered-and-not-hp-filtered-moments-why-similar-means/5555/5 "2019-04-15T12:29:29Z")

</div>

I don’t understand the question. The filtered second moments are displayed and the filtered first moments are always 0
