Monte Carlo Pdf: Sample based implementation of Pdf. More...
#include <mcpdf.h>

Public Member Functions | |
| virtual MCPdf< T > * | Clone () const |
| Clone function. More... | |
| template<> | |
| SymmetricMatrix | CovarianceGet () const |
| Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf. More... | |
| MatrixWrapper::SymmetricMatrix | CovarianceGet () const |
| Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf. More... | |
| template<> | |
| SymmetricMatrix | CovarianceGet () const |
| Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf. More... | |
| vector< double > & | CumulativePDFGet () |
| Add a sample to the list. More... | |
| template<> | |
| ColumnVector | ExpectedValueGet () const |
| Get the expected value E[x] of the pdf. More... | |
| T | ExpectedValueGet () const |
| Get the expected value E[x] of the pdf. More... | |
| template<> | |
| unsigned int | ExpectedValueGet () const |
| Get the expected value E[x] of the pdf. More... | |
| const vector< WeightedSample< T > > & | ListOfSamplesGet () const |
| Get the list of weighted samples. 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... | |
| 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... | |
| template<> | |
| MCPdf (unsigned int num_samples, unsigned int dimension) | |
| template<> | |
| MCPdf (const MCPdf &pdf) | |
| MCPdf (unsigned int num_samples=0, unsigned int dimension=0) | |
| Constructor. More... | |
| MCPdf (const MCPdf< T > &) | |
| copy constructor More... | |
| unsigned int | NumSamplesGet () const |
| Get number of samples. More... | |
| void | NumSamplesSet (unsigned int num_samples) |
| Set number of samples. More... | |
| 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 |
| const WeightedSample< T > & | SampleGet (unsigned int i) const |
| Get one sample. More... | |
| virtual | ~MCPdf () |
| destructor More... | |
Public Member Functions inherited from BFL::BFL::Pdf< T > | |
| unsigned int | DimensionGet () const |
| Get the dimension of the argument. More... | |
| virtual void | DimensionSet (unsigned int dim) |
| Set the dimension of the argument. More... | |
| Pdf (unsigned int dimension=0) | |
| Constructor. More... | |
| virtual Probability | ProbabilityGet (const T &input) const |
| Get the probability of a certain argument. More... | |
| 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) More... | |
| virtual bool | SampleFrom (Sample< T > &one_sample, int method=DEFAULT, void *args=NULL) const |
| Draw 1 sample from the Pdf: More... | |
| virtual | ~Pdf () |
| Destructor. More... | |
Protected Member Functions | |
| void | CumPDFUpdate () |
| After updating weights, we have to update the cumPDF. More... | |
| bool | NormalizeWeights () |
| Normalizing the weights. More... | |
| bool | SumWeightsUpdate () |
| STL-iterator for cumulative PDF list. More... | |
Protected Attributes | |
| vector< double > | _CumPDF |
| STL-iterator. More... | |
| vector< WeightedSample< T > > | _listOfSamples |
| STL-list containing the list of samples. More... | |
| double | _SumWeights |
| Sum of all weights: used for normalising purposes. More... | |
Private Attributes | |
| SymmetricMatrix | _covariance |
| T | _CumSum |
| T | _diff |
| Matrix | _diffsum |
| vector< WeightedSample< T > >::iterator | _it_los |
| vector< WeightedSample< T > > | _los |
| T | _mean |
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
| BFL::MCPdf< T >::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 |
|
virtual |
destructor
| BFL::MCPdf< T >::MCPdf | ( | const MCPdf< T > & | ) |
copy constructor
|
inline |
|
inline |
|
virtual |
Clone function.
Implements BFL::BFL::Pdf< T >.
|
inlinevirtual |
Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
Get first order statistic (Covariance) of this AnalyticPdf
Reimplemented from BFL::BFL::Pdf< T >.
|
virtual |
Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
Get first order statistic (Covariance) of this AnalyticPdf
Reimplemented from BFL::BFL::Pdf< T >.
|
inlinevirtual |
Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf.
Get first order statistic (Covariance) of this AnalyticPdf
Reimplemented from BFL::BFL::Pdf< T >.
|
protected |
After updating weights, we have to update the cumPDF.
| vector<double>& BFL::MCPdf< T >::CumulativePDFGet | ( | ) |
|
inlinevirtual |
Get the expected value E[x] of the pdf.
Get low order statistic (Expected Value) of this AnalyticPdf
Reimplemented from BFL::BFL::Pdf< T >.
|
virtual |
Get the expected value E[x] of the pdf.
Get low order statistic (Expected Value) of this AnalyticPdf
Reimplemented from BFL::BFL::Pdf< T >.
|
inlinevirtual |
Get the expected value E[x] of the pdf.
Get low order statistic (Expected Value) of this AnalyticPdf
Reimplemented from BFL::BFL::Pdf< T >.
| const vector<WeightedSample<T> >& BFL::MCPdf< T >::ListOfSamplesGet | ( | ) | const |
Get the list of weighted samples.
| bool BFL::MCPdf< T >::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 BFL::MCPdf< T >::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 BFL::MCPdf< T >::ListOfSamplesUpdate | ( | const vector< WeightedSample< T > > & | list_of_samples | ) |
Update the list of samples (overloaded)
| list_of_samples | the list of weighted samples |
| bool BFL::MCPdf< T >::ListOfSamplesUpdate | ( | const vector< Sample< T > > & | list_of_samples | ) |
Update the list of samples (overloaded)
| list_of_samples | the list of samples |
|
protected |
Normalizing the weights.
| unsigned int BFL::MCPdf< T >::NumSamplesGet | ( | ) | const |
Get number of samples.
| void BFL::MCPdf< T >::NumSamplesSet | ( | unsigned int | num_samples | ) |
Set number of samples.
| num_samples | the number of samples offcourse :-) |
| bool BFL::MCPdf< T >::SampleFrom | ( | Sample< T > & | one_sample, |
| int | method = DEFAULT, |
||
| void * | args = NULL |
||
| ) | const |
| bool BFL::MCPdf< T >::SampleFrom | ( | vector< Sample< T > > & | list_samples, |
| const unsigned int | num_samples, | ||
| int | method = DEFAULT, |
||
| void * | args = NULL |
||
| ) | const |
| const WeightedSample<T>& BFL::MCPdf< T >::SampleGet | ( | unsigned int | i | ) | const |
Get one sample.
| i | the ith sample |
|
protected |
STL-iterator for cumulative PDF list.
After updating weights, we have to recalculate the sum of weights
|
mutableprivate |
|
protected |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
protected |
|
mutableprivate |
|
mutableprivate |
|
protected |