Bayesian Filtering Library
Generated from SVN r
|
Monte Carlo Pdf: Sample based implementation of Pdf. More...
#include <mcpdf.h>
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, int method=DEFAULT, void *args=NULL) const |
bool | SampleFrom (vector< Sample< T > > &list_samples, const unsigned int num_samples, int method=DEFAULT, void *args=NULL) const |
T | 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. | |
virtual bool | SampleFrom (vector< Sample< T > > &list_samples, const unsigned int num_samples, int method=DEFAULT, void *args=NULL) const |
Draw multiple samples from the Pdf (overloaded) | |
virtual bool | SampleFrom (Sample< T > &one_sample, int method=DEFAULT, void *args=NULL) const |
Draw 1 sample from the 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. | |
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. | |
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. | |
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. | |
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. |
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
MCPdf | ( | unsigned int | num_samples = 0 , |
unsigned int | dimension = 0 |
||
) |
Constructor.
num_samples | the number of samples this pdf has |
dimension | the dimension of these samples. You can use this parameter to avoid runtime memory allocation and |
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
Reimplemented from Pdf< T >.
vector<double>& CumulativePDFGet | ( | ) |
unsigned int DimensionGet | ( | ) | const [inline, inherited] |
Get the dimension of the argument.
Definition at line 169 of file mixtureParticleFilter.h.
unsigned int DimensionGet | ( | ) | const [inherited] |
Get the dimension of the argument.
unsigned int DimensionGet | ( | ) | const [inherited] |
Get the dimension of the argument.
unsigned int DimensionGet | ( | ) | const [inherited] |
Get the dimension of the argument.
virtual void DimensionSet | ( | unsigned int | dim | ) | [virtual, inherited] |
Set the dimension of the argument.
dim | the dimension |
void DimensionSet | ( | unsigned int | dim | ) | [virtual, inherited] |
Set the dimension of the argument.
dim | the dimension |
Definition at line 175 of file mixtureParticleFilter.h.
virtual void DimensionSet | ( | unsigned int | dim | ) | [virtual, inherited] |
Set the dimension of the argument.
dim | the dimension |
virtual void DimensionSet | ( | unsigned int | dim | ) | [virtual, inherited] |
Set the dimension of the argument.
dim | the dimension |
T ExpectedValueGet | ( | ) | const [virtual] |
Get the expected value E[x] of the pdf.
Get low order statistic (Expected Value) of this AnalyticPdf
Reimplemented from Pdf< T >.
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.
list_of_samples | an STL-list containing the list of all weighted samples |
bool ListOfSamplesSet | ( | const vector< Sample< T > > & | list_of_samples | ) |
Overloading: Set the list of Samples (uniform weights)
list_of_samples | an STL-list containing the list of all samples |
bool ListOfSamplesUpdate | ( | const vector< WeightedSample< T > > & | list_of_samples | ) |
Update the list of samples (overloaded)
list_of_samples | the list of weighted samples |
bool ListOfSamplesUpdate | ( | const vector< Sample< T > > & | list_of_samples | ) |
Update the list of samples (overloaded)
list_of_samples | the list of samples |
unsigned int NumSamplesGet | ( | ) | const |
Get number of samples.
void NumSamplesSet | ( | unsigned int | num_samples | ) |
Set number of samples.
num_samples | the number of samples offcourse :-) |
Probability ProbabilityGet | ( | const T & | input | ) | const [virtual, inherited] |
Get the probability of a certain argument.
input | T argument of the Pdf |
Reimplemented in DiscreteConditionalPdf, Mixture< T >, Mixture< T >, DiscretePdf, DiscretePdf, Gaussian, Uniform, and ConditionalGaussian.
Definition at line 207 of file mixtureParticleFilter.h.
virtual Probability ProbabilityGet | ( | const T & | input | ) | const [virtual, inherited] |
Get the probability of a certain argument.
input | T argument of the Pdf |
Reimplemented in DiscreteConditionalPdf, Mixture< T >, Mixture< T >, DiscretePdf, DiscretePdf, Gaussian, Uniform, and ConditionalGaussian.
virtual Probability ProbabilityGet | ( | const T & | input | ) | const [virtual, inherited] |
Get the probability of a certain argument.
input | T argument of the Pdf |
Reimplemented in DiscreteConditionalPdf, Mixture< T >, Mixture< T >, DiscretePdf, DiscretePdf, Gaussian, Uniform, and ConditionalGaussian.
virtual Probability ProbabilityGet | ( | const T & | input | ) | const [virtual, inherited] |
Get the probability of a certain argument.
input | T argument of the Pdf |
Reimplemented in DiscreteConditionalPdf, Mixture< T >, Mixture< T >, DiscretePdf, DiscretePdf, Gaussian, Uniform, and ConditionalGaussian.
bool SampleFrom | ( | vector< Sample< T > > & | list_samples, |
const unsigned int | num_samples, | ||
int | method = DEFAULT , |
||
void * | args = NULL |
||
) | const [virtual, inherited] |
Draw multiple samples from the Pdf (overloaded)
list_samples | list of samples that will contain result of sampling |
num_samples | Number of Samples to be drawn (iid) |
method | Sampling method to be used. Each sampling method is currently represented by a #define statement, eg. #define BOXMULLER 1 |
args | Pointer 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... |
Reimplemented in Mixture< T >, MCPdf< T >, MCPdf< T >, and DiscretePdf.
Definition at line 182 of file mixtureParticleFilter.h.
bool SampleFrom | ( | Sample< T > & | one_sample, |
int | method = DEFAULT , |
||
void * | args = NULL |
||
) | const [virtual, inherited] |
Draw 1 sample from the Pdf:
There's no need to create a list for only 1 sample!
one_sample | sample that will contain result of sampling |
method | Sampling method to be used. Each sampling method is currently represented by a #define statement, eg. #define BOXMULLER 1 |
args | Pointer to a struct representing extra sample arguments |
Reimplemented in Mixture< T >, MCPdf< T >, MCPdf< T >, and DiscretePdf.
Definition at line 197 of file mixtureParticleFilter.h.
const WeightedSample<T>& SampleGet | ( | unsigned int | i | ) | const |
Get one sample.
i | the ith sample |
bool SumWeightsUpdate | ( | ) | [protected] |
STL-iterator for cumulative PDF list.
After updating weights, we have to recalculate the sum of weights
vector<double> _CumPDF [protected] |