19 #include "../pdf/mcpdf.h" 24 template <
typename SV>
38 template <
typename SV>
44 template <
typename SV>
bool 47 cout <<
"update started" << endl;
49 cout <<
"update fininshed" << endl;
53 template <
typename SV>
void 60 int N = (
dynamic_cast<MCPdf<SV> *
>(filtered_post))->NumSamplesGet();
63 vector<double> gamma(M);
68 const SV& x_smo =
_os_it->ValueGet();
69 double gamma_loc = 0.0;
73 const SV& x_fil =
_fs_it->ValueGet();
81 gamma_loc = gamma_loc +
_fs_it->WeightGet() * prob(i,j);
83 gamma[j-1] = gamma_loc;
102 delta = delta +
_os_it->WeightGet() * prob(i,j) / gamma[j-1];
109 weight[i-1] =
_ns_it->WeightGet()*delta;
110 tot_weight = tot_weight + weight[i-1];
117 _ns_it->WeightSet(weight[i-1]/tot_weight);
vector< WeightedSample< StateVar > >::iterator _ns_it
Iterator for new list of samples.
Class PDF: Virtual Base class representing Probability Density Functions.
vector< WeightedSample< StateVar > > _filtered_samples
While updating store 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 > >::iterator _os_it
Iterator for old list of samples.
Virtual Baseclass representing all bayesian backward filters.
vector< WeightedSample< StateVar > > _new_samples
While updating store list of new samples.
bool SystemWithoutInputs() const
Has the system inputs or not.
virtual void SysUpdate(SystemModel< StateVar > *const sysmodel, const StateVar &u, Pdf< StateVar > *const filtered_post)
Class representing a particle backward filter.
virtual ~ParticleSmoother()
Destructor.
Monte Carlo Pdf: Sample based implementation of Pdf.
Probability ProbabilityGet(const T &x_k, const T &x_kminusone, const T &u)
Get the probability of arriving in a next state.
vector< WeightedSample< StateVar > >::iterator _fs_it
Iterator for list of filtered samples.
Pdf< StateVar > * _post
Pointer to the Posterior Pdf.
const vector< WeightedSample< T > > & ListOfSamplesGet() const
Get the list of weighted samples.
bool ListOfSamplesSet(const vector< WeightedSample< T > > &list_of_samples)
Set the list of weighted samples.
vector< WeightedSample< StateVar > > _old_samples
While updating store list of old samples.