A generic class to handle a probability distribution.
More...
#include <GenericDistribution.h>
|
using | ScalarContainer = std::vector< ScalarType > |
| Scalar values container.
|
|
|
| GenericDistribution () |
| Default constructor.
|
|
virtual | ~GenericDistribution ()=default |
| Default destructor.
|
|
virtual const char * | getName () const =0 |
| Returns distribution name. More...
|
|
virtual bool | isValid () const |
| Indicates if the distribution parameters are valid. More...
|
|
virtual bool | computeParameters (const ScalarContainer &values)=0 |
| Computes the distribution parameters from a set of values. More...
|
|
virtual double | computeP (ScalarType x) const =0 |
| Computes the probability of x. More...
|
|
virtual double | computePfromZero (ScalarType x) const =0 |
| Computes the cumulative probability between 0 and x. More...
|
|
virtual double | computeP (ScalarType x1, ScalarType x2) const =0 |
| Computes the cumulative probability between x1 and x2. More...
|
|
virtual double | computeChi2Dist (const GenericCloud *Yk, unsigned numberOfClasses, int *histo=nullptr)=0 |
| Computes the Chi2 distance (related to the Chi2 Test) More...
|
|
|
void | setValid (bool state) |
| Sets distribution current validity.
|
|
|
bool | m_isValid |
| Whether the distribution is in a valid state or not.
|
|
A generic class to handle a probability distribution.
Custom parametric distributions can be implemented through this interface and used for filtering data (see StatisticalTestingTools).
◆ computeChi2Dist()
virtual double CCCoreLib::GenericDistribution::computeChi2Dist |
( |
const GenericCloud * |
Yk, |
|
|
unsigned |
numberOfClasses, |
|
|
int * |
histo = nullptr |
|
) |
| |
|
pure virtual |
Computes the Chi2 distance (related to the Chi2 Test)
Computes the Chi2 distance from a group of point, accordingly to a certain number of classes (see Chi2 test theory for more information). The result of projecting each point (or more precisely each scalar value associated to each point) in the different classes can be stored in an array (of the same size as the number of classes). To do so, such an array (already allocated in memory) should be passed as an argument. Warning: be sure to activate an OUTPUT scalar field on the input cloud
- Parameters
-
Yk | a group of points |
numberOfClasses | the number of classes for the Chi2 Test |
histo | an array to store the values projection result (optional) |
- Returns
- the Chi2 distance (or -1.0 if an error occurred)
Implemented in CCCoreLib::WeibullDistribution, and CCCoreLib::NormalDistribution.
◆ computeP() [1/2]
virtual double CCCoreLib::GenericDistribution::computeP |
( |
ScalarType |
x | ) |
const |
|
pure virtual |
◆ computeP() [2/2]
virtual double CCCoreLib::GenericDistribution::computeP |
( |
ScalarType |
x1, |
|
|
ScalarType |
x2 |
|
) |
| const |
|
pure virtual |
◆ computeParameters()
virtual bool CCCoreLib::GenericDistribution::computeParameters |
( |
const ScalarContainer & |
values | ) |
|
|
pure virtual |
◆ computePfromZero()
virtual double CCCoreLib::GenericDistribution::computePfromZero |
( |
ScalarType |
x | ) |
const |
|
pure virtual |
◆ getName()
virtual const char * CCCoreLib::GenericDistribution::getName |
( |
| ) |
const |
|
pure virtual |
◆ isValid()
virtual bool CCCoreLib::GenericDistribution::isValid |
( |
| ) |
const |
|
inlinevirtual |
Indicates if the distribution parameters are valid.
This function is related to 'computeParameters()'. If the parameters computation failed, then the parameters will be marked as 'invalid'. In this case, the dsitribution should'nt be used (most of the methods won't work anyway).
- Returns
- true (if the distribution parameters are valid) or false (if not)
The documentation for this class was generated from the following file: