# Filtered variables with particle filter

**URL:** <https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278>\
**Category:** Estimation\
**Created:** [19 February 2026 22:25 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278 "2026-02-19T22:25:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucagaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@lucagaglia](https://forum.dynare.org/u/lucagaglia)\
**Post date:** [19 February 2026 22:25 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278/1 "2026-02-19T22:25:56Z")

</div>

Hi!

Is it possible to construct a filtered series of the shocks after running the particle filter (order 3)?

I understand that the smoother is not available, but what is the closest object that can be computed with the filter?

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:** [26 February 2026 09:14 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278/2 "2026-02-26T09:14:28Z")

</div>

With the default settings that is not yet feasible. Which filter type are you using?

---

<div class="post-metadata">

**Author:** ![lucagaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@lucagaglia](https://forum.dynare.org/u/lucagaglia)\
**Post date:** [26 February 2026 14:51 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278/3 "2026-02-26T14:51:11Z")

</div>

Do you have suggestions on how to store the filtered series? As I understood, they are part of the intermediate calculations. These are the options for the filter, but I can change them if it helps:

> estimation(order = 3,
> 
> ```
> nonlinear_filter_initialization=3,
> 
> datafile = 'Output/Data', diffuse_filter, mh_nblocks=1, mh_replic=100,
> 
> mh_init_scale=4, mode_compute=5, mode_check,
> 
> posterior_graph, mh_jscale=1, plot_priors=1,
> 
> mode_check_neighbourhood_size=2, particle_filter_options = ('pruning', false))
> 
> pi_q g_q;
> 
> ```

---

<div class="post-metadata">

**Author:** ![lucagaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@lucagaglia](https://forum.dynare.org/u/lucagaglia)\
**Post date:** [4 March 2026 03:43 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278/4 "2026-03-04T03:43:59Z")

</div>

I saw that you are using a smoother in the JME paper ([GitHub - JohannesPfeifer/Particle\_Filtering: Matlab Particle Filtering and Smoothing Example Code · GitHub](https://github.com/JohannesPfeifer/Particle_Filtering)). Does this provide smoothed series for the shocks and variables?

---

<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:** [4 March 2026 07:30 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278/5 "2026-03-04T07:30:09Z")

</div>

Yes, but only for a simple AR process. I am currently working the Dynare implementation. For the filtered series that is straightforward. I hope to be able to provide something later this week.

---

<div class="post-metadata">

**Author:** ![lucagaglia](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@lucagaglia](https://forum.dynare.org/u/lucagaglia)\
**Post date:** [4 March 2026 14:01 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278/6 "2026-03-04T14:01:53Z")

</div>

Thanks, this is really helpful.

In my model, the exogenous shocks follow simple AR(1) processes. The endogenous variables do not. Is this case applicable to the GitHub smoother?

---

<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:** [4 March 2026 14:26 UTC](https://forum.dynare.org/t/filtered-variables-with-particle-filter/28278/7 "2026-03-04T14:26:19Z")

</div>

Yes, it should be.
