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. More... | |
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: More... | |
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) More... | |
T | ExpectedValueGet () const |
Get the expected value E[x] of the pdf. More... | |
MatrixWrapper::SymmetricMatrix | CovarianceGet () const |
Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf. More... | |
void | NumSamplesSet (unsigned int num_samples) |
Set number of samples. More... | |
unsigned int | NumSamplesGet () const |
Get number of samples. More... | |
const WeightedSample< T > & | SampleGet (unsigned int i) const |
Get one sample. More... | |
bool | ListOfSamplesSet (const vector< WeightedSample< T > > &list_of_samples) |
Set the list of weighted samples. More... | |
bool | ListOfSamplesSet (const vector< Sample< T > > &list_of_samples) |
Overloading: Set the list of Samples (uniform weights) More... | |
const vector< WeightedSample< T > > & | ListOfSamplesGet () const |
Get the list of weighted samples. More... | |
bool | ListOfSamplesUpdate (const vector< WeightedSample< T > > &list_of_samples) |
Update the list of samples (overloaded) More... | |
bool | ListOfSamplesUpdate (const vector< Sample< T > > &list_of_samples) |
Update the list of samples (overloaded) More... | |
vector< double > & | CumulativePDFGet () |
Add a sample to the list. More... | |
virtual Probability | ProbabilityGet (const T &input) const |
Get the probability of a certain argument. More... | |
unsigned int | DimensionGet () const |
Get the dimension of the argument. More... | |
virtual void | DimensionSet (unsigned int dim) |
Set the dimension of the argument. More... | |
Protected Member Functions | |
bool | SumWeightsUpdate () |
STL-iterator for cumulative PDF list. More... | |
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. More... | |
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 |
Definition at line 171 of file mcpdf.h.
References MCPdf< T >::_CumPDF, MCPdf< T >::_listOfSamples, and MCPdf< T >::_SumWeights.
|
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 |
|
inlineinherited |
|
virtualinherited |
|
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 |
bool ListOfSamplesSet | ( | const vector< Sample< T > > & | list_of_samples | ) |
bool ListOfSamplesSet | ( | const vector< WeightedSample< T > > & | list_of_samples | ) |
bool ListOfSamplesUpdate | ( | const vector< Sample< T > > & | list_of_samples | ) |
Update the list of samples (overloaded)
list_of_samples | the list of samples |
bool ListOfSamplesUpdate | ( | const vector< WeightedSample< T > > & | list_of_samples | ) |
Update the list of samples (overloaded)
list_of_samples | the list of weighted samples |
unsigned int NumSamplesGet |
void NumSamplesSet | ( | unsigned int | num_samples | ) |
|
virtualinherited |
Get the probability of a certain argument.
input | T argument of the Pdf |
Reimplemented in Mixture< T >.
|
virtual |
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 an enum, eg. SampleMthd::BOXMULLER |
args | Pointer to a struct representing extra sample arguments |
Reimplemented from Pdf< T >.
|
virtual |
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 an enum eg. SampleMthd::BOXMULLER |
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 from Pdf< T >.
const WeightedSample< T > & SampleGet | ( | unsigned int | i | ) | const |
|
protected |
|
protected |
STL-iterator.
STL-list containing the Cumulative PDF (for efficient sampling)
Definition at line 60 of file mcpdf.h.
Referenced by MCPdf< T >::MCPdf().