CCCoreLib 31 May 2022
CloudCompare Core algorithms
|
The Weibull statistical parametric distribution. More...
#include <WeibullDistribution.h>
Public Member Functions | |
WeibullDistribution () | |
WeibullDistribution constructor. | |
WeibullDistribution (ScalarType a, ScalarType b, ScalarType valueShift=0) | |
WeibullDistribution constructor. More... | |
bool | getParameters (ScalarType &a, ScalarType &b) const |
Returns the distribution parameters. More... | |
bool | getOtherParameters (ScalarType &mu, ScalarType &sigma2) const |
Returns the normal distribution equivalent parameters. More... | |
double | computeMode () const |
Returns the distribution 'mode'. | |
double | computeSkewness () const |
Returns the distribution 'skewness'. | |
bool | setParameters (ScalarType a, ScalarType b, ScalarType valueShift=0) |
Sets the distribution parameters. More... | |
void | setValueShift (ScalarType vs) |
Sets the distribution value shift. More... | |
ScalarType | getValueShift () const |
Returns the distribution value shift. | |
bool | computeParameters (const ScalarContainer &values) override |
Computes the distribution parameters from a set of values. More... | |
double | computeP (ScalarType x) const override |
Computes the probability of x. More... | |
double | computePfromZero (ScalarType x) const override |
Computes the cumulative probability between 0 and x. More... | |
double | computeP (ScalarType x1, ScalarType x2) const override |
Computes the cumulative probability between x1 and x2. More... | |
double | computeChi2Dist (const GenericCloud *cloud, unsigned numberOfClasses, int *histo=nullptr) override |
Computes the Chi2 distance (related to the Chi2 Test) More... | |
const char * | getName () const override |
Returns distribution name. More... | |
Public Member Functions inherited from CCCoreLib::GenericDistribution | |
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... | |
Protected Member Functions | |
virtual bool | setChi2ClassesPositions (unsigned numberOfClasses) |
Compute each Chi2 class limits. More... | |
Protected Member Functions inherited from CCCoreLib::GenericDistribution | |
void | setValid (bool state) |
Sets distribution current validity. | |
Static Protected Member Functions | |
static double | ComputeG (const ScalarContainer &values, double a, ScalarType valueShift, double valueRange) |
internal function for parameters evaluation from sample points More... | |
static double | FindGRoot (const ScalarContainer &values, ScalarType valueShift, double valueRange) |
internal function for parameters evaluation from sample points | |
Protected Attributes | |
std::vector< ScalarType > | chi2ClassesPositions |
Chi2 classes limits. More... | |
bool | parametersDefined |
Parameters validity. | |
ScalarType | m_a |
Weibull distribution parameter a (k) | |
ScalarType | m_b |
Weibull distribution parameter b (lambda) | |
ScalarType | m_valueShift |
Weibull distribution parameter 'value shift'. | |
ScalarType | m_mu |
Normal distribution equivalent parameter: mean. | |
ScalarType | m_sigma2 |
Normal distribution equivalent parameter: variance. | |
Protected Attributes inherited from CCCoreLib::GenericDistribution | |
bool | m_isValid |
Whether the distribution is in a valid state or not. | |
Additional Inherited Members | |
Public Types inherited from CCCoreLib::GenericDistribution | |
using | ScalarContainer = std::vector< ScalarType > |
Scalar values container. | |
The Weibull statistical parametric distribution.
Implements the GenericDistribution interface.
WeibullDistribution::WeibullDistribution | ( | ScalarType | a, |
ScalarType | b, | ||
ScalarType | valueShift = 0 |
||
) |
WeibullDistribution constructor.
Distrubtion parameters can be directly set during object construction.
a | the Weibull a parameter (also known as 'k') |
b | the Weibull b parameter (also known as 'lambda') |
valueShift | a value shift ('zero') |
|
overridevirtual |
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
Yk | a group of points |
numberOfClasses | the number of classes for the Chi2 Test |
histo | an array to store the values projection result (optional) |
Implements CCCoreLib::GenericDistribution.
|
staticprotected |
internal function for parameters evaluation from sample points
inverseVmax can be optionally specified for overflow-safe version
|
overridevirtual |
Computes the probability of x.
x | the variable |
Implements CCCoreLib::GenericDistribution.
|
overridevirtual |
Computes the cumulative probability between x1 and x2.
x1 should be lower than x2
x1 | the lower boundary |
x2 | the upper boundary |
Implements CCCoreLib::GenericDistribution.
|
overridevirtual |
Computes the distribution parameters from a set of values.
values | a set of scalar values |
Implements CCCoreLib::GenericDistribution.
|
overridevirtual |
Computes the cumulative probability between 0 and x.
x | the upper boundary |
Implements CCCoreLib::GenericDistribution.
|
inlineoverridevirtual |
Returns distribution name.
Implements CCCoreLib::GenericDistribution.
bool WeibullDistribution::getOtherParameters | ( | ScalarType & | mu, |
ScalarType & | sigma2 | ||
) | const |
Returns the normal distribution equivalent parameters.
mu | a field to transmit the equivalent mean |
sigma2 | a field to transmit the equivalent variance |
bool WeibullDistribution::getParameters | ( | ScalarType & | a, |
ScalarType & | b | ||
) | const |
Returns the distribution parameters.
a | the Weibull a parameter (also known as 'k') |
b | the Weibull b parameter (also known as 'lambda') |
|
protectedvirtual |
Compute each Chi2 class limits.
This method is used (internally) to accelerate the Chi2 distance computation.
numberOfClasses | the number of classes that will be used for Chi2 distance computation |
bool WeibullDistribution::setParameters | ( | ScalarType | a, |
ScalarType | b, | ||
ScalarType | valueShift = 0 |
||
) |
Sets the distribution parameters.
a | the Weibull a parameter (also known as 'k') |
b | the Weibull b parameter (also known as 'lambda') |
valueShift | a value shift ('zero') |
void WeibullDistribution::setValueShift | ( | ScalarType | vs | ) |
Sets the distribution value shift.
vs | value shift |
|
protected |
Chi2 classes limits.
Used internally. Stores both limits for each class in a vector (min_class_1, max_class_1, min_class_2, max_class_2, etc.).