CCCoreLib 31 May 2022
CloudCompare Core algorithms
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
CCCoreLib::WeibullDistribution Class Reference

The Weibull statistical parametric distribution. More...

#include <WeibullDistribution.h>

Inheritance diagram for CCCoreLib::WeibullDistribution:
Inheritance graph
[legend]
Collaboration diagram for CCCoreLib::WeibullDistribution:
Collaboration graph
[legend]

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.
 

Detailed Description

The Weibull statistical parametric distribution.

Implements the GenericDistribution interface.

Constructor & Destructor Documentation

◆ WeibullDistribution()

WeibullDistribution::WeibullDistribution ( ScalarType  a,
ScalarType  b,
ScalarType  valueShift = 0 
)

WeibullDistribution constructor.

Distrubtion parameters can be directly set during object construction.

Parameters
athe Weibull a parameter (also known as 'k')
bthe Weibull b parameter (also known as 'lambda')
valueShifta value shift ('zero')

Member Function Documentation

◆ computeChi2Dist()

double WeibullDistribution::computeChi2Dist ( const GenericCloud Yk,
unsigned  numberOfClasses,
int *  histo = nullptr 
)
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

Parameters
Yka group of points
numberOfClassesthe number of classes for the Chi2 Test
histoan array to store the values projection result (optional)
Returns
the Chi2 distance (or -1.0 if an error occurred)

Implements CCCoreLib::GenericDistribution.

◆ ComputeG()

double WeibullDistribution::ComputeG ( const ScalarContainer values,
double  a,
ScalarType  valueShift,
double  valueRange 
)
staticprotected

internal function for parameters evaluation from sample points

inverseVmax can be optionally specified for overflow-safe version

◆ computeP() [1/2]

double WeibullDistribution::computeP ( ScalarType  x) const
overridevirtual

Computes the probability of x.

Parameters
xthe variable
Returns
the probabilty

Implements CCCoreLib::GenericDistribution.

◆ computeP() [2/2]

double WeibullDistribution::computeP ( ScalarType  x1,
ScalarType  x2 
) const
overridevirtual

Computes the cumulative probability between x1 and x2.

x1 should be lower than x2

Parameters
x1the lower boundary
x2the upper boundary
Returns
the cumulative probabilty

Implements CCCoreLib::GenericDistribution.

◆ computeParameters()

bool WeibullDistribution::computeParameters ( const ScalarContainer values)
overridevirtual

Computes the distribution parameters from a set of values.

Parameters
valuesa set of scalar values
Returns
true (if the computation succeeded) or false (if not)

Implements CCCoreLib::GenericDistribution.

◆ computePfromZero()

double WeibullDistribution::computePfromZero ( ScalarType  x) const
overridevirtual

Computes the cumulative probability between 0 and x.

Parameters
xthe upper boundary
Returns
the cumulative probabilty

Implements CCCoreLib::GenericDistribution.

◆ getName()

const char * CCCoreLib::WeibullDistribution::getName ( ) const
inlineoverridevirtual

Returns distribution name.

Implements CCCoreLib::GenericDistribution.

◆ getOtherParameters()

bool WeibullDistribution::getOtherParameters ( ScalarType &  mu,
ScalarType &  sigma2 
) const

Returns the normal distribution equivalent parameters.

Parameters
mua field to transmit the equivalent mean
sigma2a field to transmit the equivalent variance
Returns
the parameters validity

◆ getParameters()

bool WeibullDistribution::getParameters ( ScalarType &  a,
ScalarType &  b 
) const

Returns the distribution parameters.

Parameters
athe Weibull a parameter (also known as 'k')
bthe Weibull b parameter (also known as 'lambda')
Returns
the parameters validity

◆ setChi2ClassesPositions()

bool WeibullDistribution::setChi2ClassesPositions ( unsigned  numberOfClasses)
protectedvirtual

Compute each Chi2 class limits.

This method is used (internally) to accelerate the Chi2 distance computation.

Parameters
numberOfClassesthe number of classes that will be used for Chi2 distance computation
Returns
success

◆ setParameters()

bool WeibullDistribution::setParameters ( ScalarType  a,
ScalarType  b,
ScalarType  valueShift = 0 
)

Sets the distribution parameters.

Parameters
athe Weibull a parameter (also known as 'k')
bthe Weibull b parameter (also known as 'lambda')
valueShifta value shift ('zero')
Returns
the parameters validity

◆ setValueShift()

void WeibullDistribution::setValueShift ( ScalarType  vs)

Sets the distribution value shift.

Parameters
vsvalue shift

Member Data Documentation

◆ chi2ClassesPositions

std::vector<ScalarType> CCCoreLib::WeibullDistribution::chi2ClassesPositions
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.).


The documentation for this class was generated from the following files: