# Particle Filtering with Missing Observations

**URL:** <https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911>\
**Category:** ML/Bayesian estimation\
**Created:** [13 June 2024 05:47 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911 "2024-06-13T05:47:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lefarmer](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/a698b9/32.png) [@lefarmer](https://forum.dynare.org/u/lefarmer)\
**Post date:** [13 June 2024 05:47 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/1 "2024-06-13T05:47:44Z")

</div>

I am wondering if there is any plan for supporting particle filter estimation of nonlinear models with missing observations. Is there any workaround to this right now? I currently want to perform estimation of a model at a monthly frequency but where some data are only observed at an annual or quarterly frequency.

---

<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:** [17 June 2024 17:21 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/2 "2024-06-17T17:21:57Z")

</div>

@stepan-a and @frederic.karame may know. But looking at the codes, it might be straightforward to implement for some filters. Which one did you have in mind?

---

<div class="post-metadata">

**Author:** ![lefarmer](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/a698b9/32.png) [@lefarmer](https://forum.dynare.org/u/lefarmer)\
**Post date:** [17 June 2024 17:38 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/3 "2024-06-17T17:38:22Z")

</div>

I was planning to use an auxiliary particle filter for parameter/state estimation but even a bootstrap particle filter would be fine.

---

<div class="post-metadata">

**Author:** ![frederic.karame](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@frederic.karame](https://forum.dynare.org/u/frederic.karame)\
**Post date:** [18 June 2024 09:16 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/4 "2024-06-18T09:16:29Z")

</div>

It is not difficult a priori.  
I will have a look Thursday.

---

<div class="post-metadata">

**Author:** ![lefarmer](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/a698b9/32.png) [@lefarmer](https://forum.dynare.org/u/lefarmer)\
**Post date:** [18 June 2024 12:23 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/5 "2024-06-18T12:23:23Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![frederic.karame](https://forum.dynare.org/letter_avatar_proxy/v4/letter/f/53a042/32.png) [@frederic.karame](https://forum.dynare.org/u/frederic.karame)\
**Post date:** [20 June 2024 10:09 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/6 "2024-06-20T10:09:09Z")

</div>

Try this and let me know (put these two files in the same rep that your mod-file).  
[auxiliary\_particle\_filter.m](https://forum.dynare.org/uploads/short-url/ipU7RK9QpOvIAOdnaNCWKZjBPnq.m) (9.8 KB)  
[sequential\_importance\_particle\_filter.m](https://forum.dynare.org/uploads/short-url/wXdNnSepjsoqcMeyvMiCa3zsUGF.m) (7.9 KB)

I will push them in Dynare unstable if it is OK.

Best,

---

<div class="post-metadata">

**Author:** ![lefarmer](https://forum.dynare.org/letter_avatar_proxy/v4/letter/l/a698b9/32.png) [@lefarmer](https://forum.dynare.org/u/lefarmer)\
**Post date:** [20 June 2024 13:04 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/7 "2024-06-20T13:04:23Z")

</div>

Thank you! I’ll give this a test and let you know.

---

<div class="post-metadata">

**Author:** ![cderesende](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@cderesende](https://forum.dynare.org/u/cderesende)\
**Post date:** [20 June 2024 19:00 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/8 "2024-06-20T19:00:01Z")

</div>

Dear Prof. Pfeifer,

I am trying for the first time to use the particle filter for the estimation of a nonlinear model with Dynare. A linear version of the mode works fine.

The command I am using is:

estimation(order=2, datafile=data\_Climate, number\_of\_particles=1000, mode\_compute=11, silent\_optimizer,mh\_replic=0);

And the error messages I am getting are:

ESTIMATION\_CHECKS: There was an error in computing the likelihood for initial parameter values.  
ESTIMATION\_CHECKS: If this is not a problem with the setting of options (check the error message below),  
ESTIMATION\_CHECKS: you should try using the calibrated version of the model as starting values. To do  
ESTIMATION\_CHECKS: this, add an empty estimated\_params\_init-block with use\_calibration option immediately before the estimation  
ESTIMATION\_CHECKS: command (and after the estimated\_params-block so that it does not get overwritten):

Error using initial\_estimation\_checks  
Error using initial\_estimation\_checks  
initial\_estimation\_checks:: particle filtering requires measurement error on the observables

Error in dynare\_estimation\_1 (line 165)  
oo\_ = initial\_estimation\_checks(objective\_function,xparam1,dataset\_,dataset\_info,M\_,estim\_params\_,options\_,bayestopt\_,bounds,oo\_);

Error in dynare\_estimation (line 105)  
dynare\_estimation\_1(var\_list,dname);

Error in Climate\_NonLin\_estim.driver (line 628)  
oo\_recursive\_=dynare\_estimation(var\_list\_);

Error in dynare (line 310)  
evalin(‘base’,[fname ‘.driver’]);

Not sure I understand what the problem is and how to follow the tentative instructions provided. I wonder whether anyone could offer some help. Many 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:** [21 June 2024 07:55 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/9 "2024-06-21T07:55:02Z")

</div>

As the message says, estimation with a particle filter requires measurement error on the observables.

---

<div class="post-metadata">

**Author:** ![cderesende](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@cderesende](https://forum.dynare.org/u/cderesende)\
**Post date:** [25 June 2024 21:25 UTC](https://forum.dynare.org/t/particle-filtering-with-missing-observations/25911/10 "2024-06-25T21:25:11Z")

</div>

> [@cderesende](#):
>
> initial\_estimation\_checks:: particle filtering requires measurement error on the observables

Many thanks! For some reason, I missed that part and focused on the initial values for the estimation block.
