Bayesian Filtering Library Generated from SVN r
MCPdf< T > Class Template Reference

Monte Carlo Pdf: Sample based implementation of Pdf. More...

#include <particlefilter.h>

Inheritance diagram for MCPdf< T >:
Pdf< T > Pdf< T >

Public Member Functions

 MCPdf (unsigned int num_samples=0, unsigned int dimension=0)
 Constructor.
 
virtual ~MCPdf ()
 destructor
 
 MCPdf (const MCPdf< T > &)
 copy constructor
 
virtual MCPdf< T > * Clone () const
 Clone function.
 
bool SampleFrom (Sample< T > &one_sample, const SampleMthd method=SampleMthd::DEFAULT, void *args=NULL) const
 Draw 1 sample from the Pdf:
 
bool SampleFrom (vector< Sample< T > > &list_samples, const unsigned int num_samples, const SampleMthd method=SampleMthd::DEFAULT, void *args=NULL) const
 Draw multiple samples from the Pdf (overloaded)
 
ExpectedValueGet () const
 Get the expected value E[x] of the pdf.
 
MatrixWrapper::SymmetricMatrix CovarianceGet () const
 Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
 
void NumSamplesSet (unsigned int num_samples)
 Set number of samples.
 
unsigned int NumSamplesGet () const
 Get number of samples.
 
const WeightedSample< T > & SampleGet (unsigned int i) const
 Get one sample.
 
bool ListOfSamplesSet (const vector< WeightedSample< T > > &list_of_samples)
 Set the list of weighted samples.
 
bool ListOfSamplesSet (const vector< Sample< T > > &list_of_samples)
 Overloading: Set the list of Samples (uniform weights)
 
const vector< WeightedSample< T > > & ListOfSamplesGet () const
 Get the list of weighted samples.
 
bool ListOfSamplesUpdate (const vector< WeightedSample< T > > &list_of_samples)
 Update the list of samples (overloaded)
 
bool ListOfSamplesUpdate (const vector< Sample< T > > &list_of_samples)
 Update the list of samples (overloaded)
 
vector< double > & CumulativePDFGet ()
 Add a sample to the list.
 
 MCPdf (unsigned int num_samples=0, unsigned int dimension=0)
 Constructor.
 
virtual ~MCPdf ()
 destructor
 
 MCPdf (const MCPdf< T > &)
 copy constructor
 
virtual MCPdf< T > * Clone () const
 Clone function.
 
bool SampleFrom (Sample< T > &one_sample, const SampleMthd method=SampleMthd::DEFAULT, void *args=NULL) const
 Draw 1 sample from the Pdf:
 
bool SampleFrom (vector< Sample< T > > &list_samples, const unsigned int num_samples, const SampleMthd method=SampleMthd::DEFAULT, void *args=NULL) const
 Draw multiple samples from the Pdf (overloaded)
 
ExpectedValueGet () const
 Get the expected value E[x] of the pdf.
 
MatrixWrapper::SymmetricMatrix CovarianceGet () const
 Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
 
void NumSamplesSet (unsigned int num_samples)
 Set number of samples.
 
unsigned int NumSamplesGet () const
 Get number of samples.
 
const WeightedSample< T > & SampleGet (unsigned int i) const
 Get one sample.
 
bool ListOfSamplesSet (const vector< WeightedSample< T > > &list_of_samples)
 Set the list of weighted samples.
 
bool ListOfSamplesSet (const vector< Sample< T > > &list_of_samples)
 Overloading: Set the list of Samples (uniform weights)
 
const vector< WeightedSample< T > > & ListOfSamplesGet () const
 Get the list of weighted samples.
 
bool ListOfSamplesUpdate (const vector< WeightedSample< T > > &list_of_samples)
 Update the list of samples (overloaded)
 
bool ListOfSamplesUpdate (const vector< Sample< T > > &list_of_samples)
 Update the list of samples (overloaded)
 
vector< double > & CumulativePDFGet ()
 Add a sample to the list.
 
 MCPdf (unsigned int num_samples, unsigned int dimension)
 
 MCPdf (const MCPdf &pdf)
 
ColumnVector ExpectedValueGet () const
 Get the expected value E[x] of the pdf.
 
SymmetricMatrix CovarianceGet () const
 Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
 
unsigned int ExpectedValueGet () const
 Get the expected value E[x] of the pdf.
 
SymmetricMatrix CovarianceGet () const
 Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
 
 MCPdf (unsigned int num_samples, unsigned int dimension)
 
 MCPdf (const MCPdf &pdf)
 
ColumnVector ExpectedValueGet () const
 Get the expected value E[x] of the pdf.
 
SymmetricMatrix CovarianceGet () const
 Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
 
unsigned int ExpectedValueGet () const
 Get the expected value E[x] of the pdf.
 
SymmetricMatrix CovarianceGet () const
 Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
 
virtual Probability ProbabilityGet (const T &input) const
 Get the probability of a certain argument.
 
virtual Probability ProbabilityGet (const T &input) const
 Get the probability of a certain argument.
 
virtual Probability ProbabilityGet (const T &input) const
 Get the probability of a certain argument.
 
unsigned int DimensionGet () const
 Get the dimension of the argument.
 
unsigned int DimensionGet () const
 Get the dimension of the argument.
 
unsigned int DimensionGet () const
 Get the dimension of the argument.
 
virtual void DimensionSet (unsigned int dim)
 Set the dimension of the argument.
 
virtual void DimensionSet (unsigned int dim)
 Set the dimension of the argument.
 
virtual void DimensionSet (unsigned int dim)
 Set the dimension of the argument.
 

Protected Member Functions

bool SumWeightsUpdate ()
 STL-iterator for cumulative PDF list.
 
bool NormalizeWeights ()
 Normalizing the weights.
 
void CumPDFUpdate ()
 After updating weights, we have to update the cumPDF.
 
bool SumWeightsUpdate ()
 STL-iterator for cumulative PDF list.
 
bool NormalizeWeights ()
 Normalizing the weights.
 
void CumPDFUpdate ()
 After updating weights, we have to update the cumPDF.
 

Protected Attributes

double _SumWeights
 Sum of all weights: used for normalising purposes.
 
vector< WeightedSample< T > > _listOfSamples
 STL-list containing the list of samples.
 
vector< double > _CumPDF
 STL-iterator.
 

Detailed Description

template<typename T>
class BFL::BFL::MCPdf< T >

Monte Carlo Pdf: Sample based implementation of Pdf.

Class Monte Carlo Pdf: This is a sample based representation of a Pdf P(x), which can both be continu or discrete

Todo
This class can and should be made far more efficient!!!

Class Monte Carlo Pdf: This is a sample based representation of a Pdf P(x), which can both be continu or discrete

Todo
This class can and should be made far more efficient!!!

Class Monte Carlo Pdf: This is a sample based representation of a Pdf P(x), which can both be continu or discrete

Todo
This class can and should be made far more efficient!!!

Definition at line 49 of file particlesmoother.h.

Constructor & Destructor Documentation

◆ MCPdf() [1/6]

template<typename T >
MCPdf ( unsigned int num_samples = 0,
unsigned int dimension = 0 )

Constructor.

Parameters
num_samplesthe number of samples this pdf has
dimensionthe dimension of these samples. You can use this parameter to avoid runtime memory allocation and

Definition at line 171 of file particlefilter.h.

◆ ~MCPdf()

template<typename T >
~MCPdf ( )
virtual

destructor

Definition at line 195 of file particlefilter.h.

◆ MCPdf() [2/6]

template<typename T >
MCPdf ( unsigned int num_samples = 0,
unsigned int dimension = 0 )

Constructor.

Parameters
num_samplesthe number of samples this pdf has
dimensionthe dimension of these samples. You can use this parameter to avoid runtime memory allocation and

◆ MCPdf() [3/6]

MCPdf ( unsigned int num_samples,
unsigned int dimension )
inline

Definition at line 32 of file particlefilter.h.

◆ MCPdf() [4/6]

template<typename T >
MCPdf ( const MCPdf< T > & pdf)
inline

Definition at line 58 of file particlefilter.h.

◆ MCPdf() [5/6]

MCPdf ( unsigned int num_samples,
unsigned int dimension )
inline

Definition at line 32 of file particlesmoother.h.

◆ MCPdf() [6/6]

MCPdf ( const MCPdf< T > & pdf)
inline

Definition at line 58 of file particlesmoother.h.

Member Function Documentation

◆ Clone() [1/2]

template<typename T >
MCPdf< T > * Clone ( ) const
virtual

Clone function.

Implements Pdf< T >.

Definition at line 222 of file particlefilter.h.

◆ Clone() [2/2]

template<typename T >
virtual MCPdf< T > * Clone ( ) const
virtual

Clone function.

Implements Pdf< T >.

◆ CovarianceGet() [1/6]

SymmetricMatrix CovarianceGet ( ) const
inlinevirtual

Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Reimplemented from Pdf< T >.

Definition at line 89 of file particlefilter.h.

◆ CovarianceGet() [2/6]

SymmetricMatrix CovarianceGet ( ) const
inlinevirtual

Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Reimplemented from Pdf< T >.

Definition at line 89 of file particlesmoother.h.

◆ CovarianceGet() [3/6]

SymmetricMatrix CovarianceGet ( ) const
inlinevirtual

Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Reimplemented from Pdf< T >.

Definition at line 131 of file particlefilter.h.

◆ CovarianceGet() [4/6]

SymmetricMatrix CovarianceGet ( ) const
inlinevirtual

Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Reimplemented from Pdf< T >.

Definition at line 131 of file particlesmoother.h.

◆ CovarianceGet() [5/6]

template<typename T >
MatrixWrapper::SymmetricMatrix CovarianceGet ( ) const
virtual

Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Reimplemented from Pdf< T >.

Definition at line 541 of file particlefilter.h.

◆ CovarianceGet() [6/6]

template<typename T >
MatrixWrapper::SymmetricMatrix CovarianceGet ( ) const
virtual

Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Get first order statistic (Covariance) of this AnalyticPdf

Returns
The Covariance of the Pdf (a SymmetricMatrix of dim DIMENSION)
Todo
extend this more general to n-th order statistic
Bug
Discrete pdfs should not be able to use this!

Reimplemented from Pdf< T >.

◆ CumPDFUpdate()

template<typename T >
void CumPDFUpdate ( )
protected

After updating weights, we have to update the cumPDF.

Definition at line 510 of file particlefilter.h.

◆ CumulativePDFGet() [1/2]

template<typename T >
vector< double > & CumulativePDFGet ( )

Add a sample to the list.

Parameters
samplethe sample to be added
Todo
what's the best way to remove some samples?

Get the Cumulative Pdf

Returns
a vector of doubles representing the CumulativePDF
Parameters
samplethe sample to be added
Todo
what's the best way to remove some samples?

Get the Cumulative Pdf

Returns
a vector of doubles representing the CumulativePDF

Definition at line 554 of file particlefilter.h.

◆ CumulativePDFGet() [2/2]

template<typename T >
vector< double > & CumulativePDFGet ( )

Add a sample to the list.

Parameters
samplethe sample to be added
Todo
what's the best way to remove some samples?

Get the Cumulative Pdf

Returns
a vector of doubles representing the CumulativePDF

◆ DimensionGet() [1/3]

template<typename T >
unsigned int DimensionGet ( ) const
inlineinherited

Get the dimension of the argument.

Returns
the dimension of the argument

Definition at line 166 of file mixtureParticleFilter.h.

◆ DimensionGet() [2/3]

template<typename T >
unsigned int DimensionGet ( ) const
inherited

Get the dimension of the argument.

Returns
the dimension of the argument

◆ DimensionGet() [3/3]

template<typename T >
unsigned int DimensionGet ( ) const
inherited

Get the dimension of the argument.

Returns
the dimension of the argument

◆ DimensionSet() [1/3]

template<typename T >
void DimensionSet ( unsigned int dim)
virtualinherited

Set the dimension of the argument.

Parameters
dimthe dimension

Reimplemented in Gaussian.

Definition at line 172 of file mixtureParticleFilter.h.

◆ DimensionSet() [2/3]

template<typename T >
virtual void DimensionSet ( unsigned int dim)
virtualinherited

Set the dimension of the argument.

Parameters
dimthe dimension

Reimplemented in Gaussian.

◆ DimensionSet() [3/3]

template<typename T >
virtual void DimensionSet ( unsigned int dim)
virtualinherited

Set the dimension of the argument.

Parameters
dimthe dimension

Reimplemented in Gaussian.

◆ ExpectedValueGet() [1/6]

ColumnVector ExpectedValueGet ( ) const
inlinevirtual

Get the expected value E[x] of the pdf.

Get low order statistic (Expected Value) of this AnalyticPdf

Returns
The Expected Value of the Pdf (a ColumnVector with DIMENSION rows)
Note
No set functions here! This can be useful for analytic functions, but not for sample based representations!
For certain discrete Pdfs, this function has no meaning, what is the average between yes and no?

Reimplemented from Pdf< T >.

Definition at line 78 of file particlefilter.h.

◆ ExpectedValueGet() [2/6]

ColumnVector ExpectedValueGet ( ) const
inlinevirtual

Get the expected value E[x] of the pdf.

Get low order statistic (Expected Value) of this AnalyticPdf

Returns
The Expected Value of the Pdf (a ColumnVector with DIMENSION rows)
Note
No set functions here! This can be useful for analytic functions, but not for sample based representations!
For certain discrete Pdfs, this function has no meaning, what is the average between yes and no?

Reimplemented from Pdf< T >.

Definition at line 78 of file particlesmoother.h.

◆ ExpectedValueGet() [3/6]

unsigned int ExpectedValueGet ( ) const
inlinevirtual

Get the expected value E[x] of the pdf.

Get low order statistic (Expected Value) of this AnalyticPdf

Returns
The Expected Value of the Pdf (a ColumnVector with DIMENSION rows)
Note
No set functions here! This can be useful for analytic functions, but not for sample based representations!
For certain discrete Pdfs, this function has no meaning, what is the average between yes and no?

Reimplemented from Pdf< T >.

Definition at line 112 of file particlefilter.h.

◆ ExpectedValueGet() [4/6]

unsigned int ExpectedValueGet ( ) const
inlinevirtual

Get the expected value E[x] of the pdf.

Get low order statistic (Expected Value) of this AnalyticPdf

Returns
The Expected Value of the Pdf (a ColumnVector with DIMENSION rows)
Note
No set functions here! This can be useful for analytic functions, but not for sample based representations!
For certain discrete Pdfs, this function has no meaning, what is the average between yes and no?

Reimplemented from Pdf< T >.

Definition at line 112 of file particlesmoother.h.

◆ ExpectedValueGet() [5/6]

template<typename T >
T ExpectedValueGet ( ) const
virtual

Get the expected value E[x] of the pdf.

Get low order statistic (Expected Value) of this AnalyticPdf

Returns
The Expected Value of the Pdf (a ColumnVector with DIMENSION rows)
Note
No set functions here! This can be useful for analytic functions, but not for sample based representations!
For certain discrete Pdfs, this function has no meaning, what is the average between yes and no?

Reimplemented from Pdf< T >.

Definition at line 529 of file particlefilter.h.

◆ ExpectedValueGet() [6/6]

template<typename T >
T ExpectedValueGet ( ) const
virtual

Get the expected value E[x] of the pdf.

Get low order statistic (Expected Value) of this AnalyticPdf

Returns
The Expected Value of the Pdf (a ColumnVector with DIMENSION rows)
Note
No set functions here! This can be useful for analytic functions, but not for sample based representations!
For certain discrete Pdfs, this function has no meaning, what is the average between yes and no?

Reimplemented from Pdf< T >.

◆ ListOfSamplesGet() [1/2]

template<typename T >
const vector< WeightedSample< T > > & ListOfSamplesGet ( ) const

Get the list of weighted samples.

Returns
an STL-list with the list of weighted samples

Definition at line 422 of file particlefilter.h.

◆ ListOfSamplesGet() [2/2]

template<typename T >
const vector< WeightedSample< T > > & ListOfSamplesGet ( ) const

Get the list of weighted samples.

Returns
an STL-list with the list of weighted samples

◆ ListOfSamplesSet() [1/4]

template<typename T >
bool ListOfSamplesSet ( const vector< Sample< T > > & list_of_samples)

Overloading: Set the list of Samples (uniform weights)

Parameters
list_of_samplesan STL-list containing the list of all samples

Definition at line 395 of file particlefilter.h.

◆ ListOfSamplesSet() [2/4]

template<typename T >
bool ListOfSamplesSet ( const vector< Sample< T > > & list_of_samples)

Overloading: Set the list of Samples (uniform weights)

Parameters
list_of_samplesan STL-list containing the list of all samples

◆ ListOfSamplesSet() [3/4]

template<typename T >
bool ListOfSamplesSet ( const vector< WeightedSample< T > > & list_of_samples)

Set the list of weighted samples.

Parameters
list_of_samplesan STL-list containing the list of all weighted samples

Definition at line 382 of file particlefilter.h.

◆ ListOfSamplesSet() [4/4]

template<typename T >
bool ListOfSamplesSet ( const vector< WeightedSample< T > > & list_of_samples)

Set the list of weighted samples.

Parameters
list_of_samplesan STL-list containing the list of all weighted samples

◆ ListOfSamplesUpdate() [1/4]

template<typename T >
bool ListOfSamplesUpdate ( const vector< Sample< T > > & list_of_samples)

Update the list of samples (overloaded)

Parameters
list_of_samplesthe list of samples
Precondition
list_of_samples must contain exactly as many elements as this->NumSamplesGet() returns

Definition at line 441 of file particlefilter.h.

◆ ListOfSamplesUpdate() [2/4]

template<typename T >
bool ListOfSamplesUpdate ( const vector< Sample< T > > & list_of_samples)

Update the list of samples (overloaded)

Parameters
list_of_samplesthe list of samples
Precondition
list_of_samples must contain exactly as many elements as this->NumSamplesGet() returns

◆ ListOfSamplesUpdate() [3/4]

template<typename T >
bool ListOfSamplesUpdate ( const vector< WeightedSample< T > > & list_of_samples)

Update the list of samples (overloaded)

Parameters
list_of_samplesthe list of weighted samples
Precondition
list_of_samples must contain exactly as many elements as this->NumSamplesGet() returns

Definition at line 429 of file particlefilter.h.

◆ ListOfSamplesUpdate() [4/4]

template<typename T >
bool ListOfSamplesUpdate ( const vector< WeightedSample< T > > & list_of_samples)

Update the list of samples (overloaded)

Parameters
list_of_samplesthe list of weighted samples
Precondition
list_of_samples must contain exactly as many elements as this->NumSamplesGet() returns

◆ NormalizeWeights()

template<typename T >
bool NormalizeWeights ( )
protected

Normalizing the weights.

Definition at line 492 of file particlefilter.h.

◆ NumSamplesGet() [1/2]

template<typename T >
unsigned int NumSamplesGet ( ) const

Get number of samples.

Returns
the number of samples

Definition at line 330 of file particlefilter.h.

◆ NumSamplesGet() [2/2]

template<typename T >
unsigned int NumSamplesGet ( ) const

Get number of samples.

Returns
the number of samples

◆ NumSamplesSet() [1/2]

template<typename T >
void NumSamplesSet ( unsigned int num_samples)

Set number of samples.

Parameters
num_samplesthe number of samples offcourse :-)
See also
sample, weightedsample

Definition at line 344 of file particlefilter.h.

◆ NumSamplesSet() [2/2]

template<typename T >
void NumSamplesSet ( unsigned int num_samples)

Set number of samples.

Parameters
num_samplesthe number of samples offcourse :-)
See also
sample, weightedsample

◆ ProbabilityGet() [1/3]

template<typename T >
Probability ProbabilityGet ( const T & input) const
virtualinherited

Get the probability of a certain argument.

Parameters
inputT argument of the Pdf
Returns
the probability value of the argument

Reimplemented in DiscretePdf, Mixture< T >, ConditionalGaussian, DiscreteConditionalPdf, Gaussian, and Uniform.

Definition at line 204 of file mixtureParticleFilter.h.

◆ ProbabilityGet() [2/3]

template<typename T >
virtual Probability ProbabilityGet ( const T & input) const
virtualinherited

Get the probability of a certain argument.

Parameters
inputT argument of the Pdf
Returns
the probability value of the argument

Reimplemented in DiscretePdf, Mixture< T >, ConditionalGaussian, DiscreteConditionalPdf, Gaussian, and Uniform.

◆ ProbabilityGet() [3/3]

template<typename T >
virtual Probability ProbabilityGet ( const T & input) const
virtualinherited

Get the probability of a certain argument.

Parameters
inputT argument of the Pdf
Returns
the probability value of the argument

Reimplemented in DiscretePdf, Mixture< T >, ConditionalGaussian, DiscreteConditionalPdf, Gaussian, and Uniform.

◆ SampleFrom() [1/4]

template<typename T >
bool SampleFrom ( Sample< T > & one_sample,
const SampleMthd method = SampleMthd::DEFAULT,
void * args = NULL ) const
virtual

Draw 1 sample from the Pdf:

There's no need to create a list for only 1 sample!

Parameters
one_samplesample that will contain result of sampling
methodSampling method to be used. Each sampling method is currently represented by an enum, eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments
See also
SampleFrom()
Bug
Sometimes the compiler doesn't know which method to choose!

There's no need to create a list for only 1 sample!

Parameters
one_samplesample that will contain result of sampling
methodSampling method to be used. Each sampling method is currently represented by an enum, eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments
See also
SampleFrom()
Bug
Sometimes the compiler doesn't know which method to choose!

Reimplemented from Pdf< T >.

Definition at line 295 of file particlefilter.h.

◆ SampleFrom() [2/4]

template<typename T >
bool SampleFrom ( Sample< T > & one_sample,
const SampleMthd method = SampleMthd::DEFAULT,
void * args = NULL ) const
virtual

Draw 1 sample from the Pdf:

There's no need to create a list for only 1 sample!

Parameters
one_samplesample that will contain result of sampling
methodSampling method to be used. Each sampling method is currently represented by an enum, eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments
See also
SampleFrom()
Bug
Sometimes the compiler doesn't know which method to choose!

There's no need to create a list for only 1 sample!

Parameters
one_samplesample that will contain result of sampling
methodSampling method to be used. Each sampling method is currently represented by an enum, eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments
See also
SampleFrom()
Bug
Sometimes the compiler doesn't know which method to choose!

Reimplemented from Pdf< T >.

◆ SampleFrom() [3/4]

template<typename T >
bool SampleFrom ( vector< Sample< T > > & list_samples,
const unsigned int num_samples,
const SampleMthd method = SampleMthd::DEFAULT,
void * args = NULL ) const
virtual

Draw multiple samples from the Pdf (overloaded)

Parameters
list_sampleslist of samples that will contain result of sampling
num_samplesNumber of Samples to be drawn (iid)
methodSampling method to be used. Each sampling method is currently represented by an enum eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments. "Sample Arguments" can be anything (the number of steps a gibbs-iterator should take, the interval width in MCMC, ... (or nothing), so it is hard to give a meaning to what exactly Sample Arguments should represent...
Todo
replace the C-call "void * args" by a more object-oriented structure: Perhaps something like virtual Sample * Sample (const int num_samples,class Sampler)
Bug
Sometimes the compiler doesn't know which method to choose!
Parameters
list_sampleslist of samples that will contain result of sampling
num_samplesNumber of Samples to be drawn (iid)
methodSampling method to be used. Each sampling method is currently represented by an enum eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments. "Sample Arguments" can be anything (the number of steps a gibbs-iterator should take, the interval width in MCMC, ... (or nothing), so it is hard to give a meaning to what exactly Sample Arguments should represent...
Todo
replace the C-call "void * args" by a more object-oriented structure: Perhaps something like virtual Sample * Sample (const int num_samples,class Sampler)
Bug
Sometimes the compiler doesn't know which method to choose!

Reimplemented from Pdf< T >.

Definition at line 228 of file particlefilter.h.

◆ SampleFrom() [4/4]

template<typename T >
bool SampleFrom ( vector< Sample< T > > & list_samples,
const unsigned int num_samples,
const SampleMthd method = SampleMthd::DEFAULT,
void * args = NULL ) const
virtual

Draw multiple samples from the Pdf (overloaded)

Parameters
list_sampleslist of samples that will contain result of sampling
num_samplesNumber of Samples to be drawn (iid)
methodSampling method to be used. Each sampling method is currently represented by an enum eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments. "Sample Arguments" can be anything (the number of steps a gibbs-iterator should take, the interval width in MCMC, ... (or nothing), so it is hard to give a meaning to what exactly Sample Arguments should represent...
Todo
replace the C-call "void * args" by a more object-oriented structure: Perhaps something like virtual Sample * Sample (const int num_samples,class Sampler)
Bug
Sometimes the compiler doesn't know which method to choose!
Parameters
list_sampleslist of samples that will contain result of sampling
num_samplesNumber of Samples to be drawn (iid)
methodSampling method to be used. Each sampling method is currently represented by an enum eg. SampleMthd::BOXMULLER
argsPointer to a struct representing extra sample arguments. "Sample Arguments" can be anything (the number of steps a gibbs-iterator should take, the interval width in MCMC, ... (or nothing), so it is hard to give a meaning to what exactly Sample Arguments should represent...
Todo
replace the C-call "void * args" by a more object-oriented structure: Perhaps something like virtual Sample * Sample (const int num_samples,class Sampler)
Bug
Sometimes the compiler doesn't know which method to choose!

Reimplemented from Pdf< T >.

◆ SampleGet() [1/2]

template<typename T >
const WeightedSample< T > & SampleGet ( unsigned int i) const

Get one sample.

Returns
sample
Parameters
ithe ith sample

Definition at line 336 of file particlefilter.h.

◆ SampleGet() [2/2]

template<typename T >
const WeightedSample< T > & SampleGet ( unsigned int i) const

Get one sample.

Returns
sample
Parameters
ithe ith sample

◆ SumWeightsUpdate() [1/2]

template<typename T >
bool SumWeightsUpdate ( )
protected

STL-iterator for cumulative PDF list.

After updating weights, we have to recalculate the sum of weights

Definition at line 466 of file particlefilter.h.

◆ SumWeightsUpdate() [2/2]

template<typename T >
bool SumWeightsUpdate ( )
protected

STL-iterator for cumulative PDF list.

After updating weights, we have to recalculate the sum of weights

Member Data Documentation

◆ _CumPDF

template<typename T >
vector< double > _CumPDF
protected

STL-iterator.

STL-list containing the Cumulative PDF (for efficient sampling)

Definition at line 60 of file particlefilter.h.

◆ _listOfSamples

template<typename T >
vector< WeightedSample< T > > _listOfSamples
protected

STL-list containing the list of samples.

Definition at line 56 of file particlefilter.h.

◆ _SumWeights

template<typename T >
double _SumWeights
protected

Sum of all weights: used for normalising purposes.

Definition at line 54 of file particlefilter.h.


The documentation for this class was generated from the following files: