Statistical testing algorithms (Chi2 distance computation, statistic filtering, etc.)
More...
#include <StatisticalTestingTools.h>
|
static double | computeAdaptativeChi2Dist (const GenericDistribution *distrib, const GenericCloud *cloud, unsigned numberOfClasses, unsigned &finalNumberOfClasses, bool noClassCompression=false, const ScalarType *histoMin=nullptr, const ScalarType *histoMax=nullptr, unsigned *histoValues=nullptr, double *npis=nullptr) |
| Computes the Chi2 distance on a sample of scalar values. More...
|
|
static double | computeChi2Fractile (double p, int d) |
| Computes the Chi2 fractile. More...
|
|
static double | computeChi2Probability (double chi2result, int d) |
| Computes the Chi2 confidence probability. More...
|
|
static double | testCloudWithStatisticalModel (const GenericDistribution *distrib, GenericIndexedCloudPersist *theCloud, unsigned numberOfNeighbours, double pTrust, GenericProgressCallback *progressCb=nullptr, DgmOctree *inputOctree=nullptr) |
| Classfies the point cloud in two category by locally applying a statistical (Chi2) test. More...
|
|
Statistical testing algorithms (Chi2 distance computation, statistic filtering, etc.)
◆ computeAdaptativeChi2Dist()
double StatisticalTestingTools::computeAdaptativeChi2Dist |
( |
const GenericDistribution * |
distrib, |
|
|
const GenericCloud * |
cloud, |
|
|
unsigned |
numberOfClasses, |
|
|
unsigned & |
finalNumberOfClasses, |
|
|
bool |
noClassCompression = false , |
|
|
const ScalarType * |
histoMin = nullptr , |
|
|
const ScalarType * |
histoMax = nullptr , |
|
|
unsigned * |
histoValues = nullptr , |
|
|
double * |
npis = nullptr |
|
) |
| |
|
static |
Computes the Chi2 distance on a sample of scalar values.
The Chi2 distance is computed between an empiric distribution generated from a set of scalar values (with a specific number of classes), and a theoretical distribution. It assures that each class of the empirical distribution is such that it respects n.pi>=5 (where n is the total number of points, and pi is the cumulative probability of the class). Therefore the number of classes can be changed by the method. If the 'noClassCompression' parameter is set to true, the above condition is not checked and distance can diverge (which should not be possible according to the Chi2 Test theory, but it can be useful for classification purposes).
- Parameters
-
| distrib | a theoretical distribution |
| cloud | a subset of points (associated to scalar values) |
| numberOfClasses | initial number of classes for the empirical distribution (0 for automatic determination, >1 otherwise) |
| finalNumberOfClasses | final number of classes of the empirical distribution |
| noClassCompression | prevent the algorithm from performing classes compression (faster but less accurate) |
| histoMin | [optional] minimum histogram value |
| histoMax | [optional] maximum histogram value |
[out] | histoValues | [optional] histogram array (its size should be equal to the initial number of classes) |
[out] | npis | [optional] array containing the theoretical probabilities for each class (its size should be equal to the initial number of classes) |
- Returns
- the Chi2 distance (or -1.0 if an error occurred)
◆ computeChi2Fractile()
double StatisticalTestingTools::computeChi2Fractile |
( |
double |
p, |
|
|
int |
d |
|
) |
| |
|
static |
Computes the Chi2 fractile.
Returns the max Chi2 Distance for a given "confidence" probability and a given number of "degrees of liberty" (equivalent to the number of classes-1).
- Parameters
-
p | the result "confidence" |
d | the number of d.o.l. |
- Returns
- the Chi2 fractile
◆ computeChi2Probability()
double StatisticalTestingTools::computeChi2Probability |
( |
double |
chi2result, |
|
|
int |
d |
|
) |
| |
|
static |
Computes the Chi2 confidence probability.
Returns the Chi2 confidence probability for a given Chi2 distance value and a given number of "degress of liberty" (equivalent to the number of classes-1).
- Parameters
-
chi2result | the Chi2 distance |
d | the number of d.o.l. |
- Returns
- the Chi2 confidence probability
◆ computeLocalChi2DistAtLevel()
Computes (locally) the Chi2 distance inside an octree cell.
Additional parameters are:
- (GenericDistribution*) the theoretical noise distribution
- (int) the size of a neighbourhood for local analysis
- (int) the number of classes for the Chi2 distance computation
- (unsigned*) a pre-allocated array (of a size equal to the number of classes)for computation acceleration
- (bool) specifies whether negative values should be included in computation
- Parameters
-
cell | structure describing the cell on which processing is applied |
additionalParameters | see method description |
nProgress | optional (normalized) progress notification (per-point) |
◆ testCloudWithStatisticalModel()
Classfies the point cloud in two category by locally applying a statistical (Chi2) test.
This algorithm is described in Daniel Girardeau-Montaut's PhD manuscript (Chapter 3. section 3.2.3). It mainly consists in determining if a point associated scalar value is part of the measurements noise (in which case the point will be considered as "unchanged") or if not (in which case the point will be considered as a trully "changed"). This determination is based on a statistical analysis (Chi2 Test) of the scalar values distribution around each point (by considering a small neighbourhood of points around each point). The classification result will depend on the Chi2 Test parameters (e.g. the number of classes - which in this case is equal to the square root of the neighbourhood size - and the confidence probability - the greater it is, the more severe the result is). WARNING : the scalar field behind the GenericIndexedCloud interface should be splet in 2, one for reading the scalar values to test (OUT - getScalarValue) and the other to save the resulting Chi2 distance (IN - setScalarValue).
- Parameters
-
distrib | a theoretical noise distribution |
theCloud | the point cloud to classify |
numberOfNeighbours | the neighbourhood size for the local analysis |
pTrust | the Chi2 Test confidence probability |
progressCb | the client application can get some notification of the process progress through this callback mechanism (see GenericProgressCallback) |
inputOctree | the cloud octree if it has already be computed |
- Returns
- the distance threshold for filtering (or -1 if someting went wrong during the process)
The documentation for this class was generated from the following files:
- StatisticalTestingTools.h
- StatisticalTestingTools.cpp