Bayesian Filtering Library Generated from SVN r
particlesmoother.h
1// $Id: particlesmoother.h 6736 2006-12-21 11:24:42Z tdelaet $
2// Copyright (C) 2006 Tinne De Laet <first dot last at mech dot kuleuven dot be>
3//
4 /***************************************************************************
5 * This library is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public *
7 * License as published by the Free Software Foundation; *
8 * version 2 of the License. *
9 * *
10 * As a special exception, you may use this file as part of a free *
11 * software library without restriction. Specifically, if other files *
12 * instantiate templates or use macros or inline functions from this *
13 * file, or you compile this file and link it with other files to *
14 * produce an executable, this file does not by itself cause the *
15 * resulting executable to be covered by the GNU General Public *
16 * License. This exception does not however invalidate any other *
17 * reasons why the executable file might be covered by the GNU General *
18 * Public License. *
19 * *
20 * This library is distributed in the hope that it will be useful, *
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
23 * Lesser General Public License for more details. *
24 * *
25 * You should have received a copy of the GNU General Public *
26 * License along with this library; if not, write to the Free Software *
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
28 * Boston, MA 02110-1301 USA *
29 * *
30 ***************************************************************************/
31
32
33// implementation based on "A smoothing filter for condensation", by Isard and
34// Blake
35// (http://www.springerlink.com/content/?k=a+smoothing+filter+for+condensation)
36// The bacward stage version
37// @bug still needs extra testing!
39#ifndef __PARTICLE_SMOOTHER__
40#define __PARTICLE_SMOOTHER__
42#include "backwardfilter.h"
43#include "../pdf/conditionalpdf.h"
44#include "../pdf/mcpdf.h"
46namespace BFL
50 template <typename StateVar> class ParticleSmoother
51 : public BackwardFilter<StateVar>
52 {
53 protected:
54 virtual bool UpdateInternal(SystemModel<StateVar>* const sysmodel,
55 const StateVar& u, Pdf<StateVar>* const filtered_post);
56
57 virtual void SysUpdate(SystemModel<StateVar>* const sysmodel, const StateVar& u , Pdf<StateVar>* const filtered_post);
60 vector<WeightedSample<StateVar> > _old_samples;
62 vector<WeightedSample<StateVar> > _new_samples;
64 vector<WeightedSample<StateVar> > _filtered_samples;
66 typename vector<WeightedSample<StateVar> >::iterator _os_it;
68 typename vector<WeightedSample<StateVar> >::iterator _ns_it;
70 typename vector<WeightedSample<StateVar> >::iterator _fs_it;
72 public:
77 virtual ~ParticleSmoother();
79 };
80#include "particlesmoother.cpp"
82} // End namespace BFL
84#endif // __PARTICLE_FILTER__
Monte Carlo Pdf: Sample based implementation of Pdf.
Class PDF: Virtual Base class representing Probability Density Functions.
Virtual Baseclass representing all bayesian backward filters.
Class representing a particle backward filter.
vector< WeightedSample< StateVar > >::iterator _fs_it
Iterator for list of filtered samples.
virtual bool UpdateInternal(SystemModel< StateVar > *const sysmodel, const StateVar &u, Pdf< StateVar > *const filtered_post)
Actual implementation of Update, varies along filters.
vector< WeightedSample< StateVar > > _filtered_samples
While updating store list of filtered samples.
vector< WeightedSample< StateVar > > _old_samples
While updating store list of old samples.
vector< WeightedSample< StateVar > >::iterator _ns_it
Iterator for new list of samples.
vector< WeightedSample< StateVar > > _new_samples
While updating store list of new samples.
ParticleSmoother(MCPdf< StateVar > *prior)
Constructor.
vector< WeightedSample< StateVar > >::iterator _os_it
Iterator for old list of samples.
virtual ~ParticleSmoother()
Destructor.