Visual Servoing Platform
version 3.6.1 under development (2024-11-15)
|
#include <visp3/core/vpStatisticalTestAbstract.h>
Public Types | |
enum | vpMeanDriftType { MEAN_DRIFT_NONE = 0 , MEAN_DRIFT_DOWNWARD = 1 , MEAN_DRIFT_UPWARD = 2 , MEAN_DRIFT_BOTH = 3 , MEAN_DRIFT_COUNT = 4 , MEAN_DRIFT_UNKNOWN = MEAN_DRIFT_COUNT } |
typedef enum vpStatisticalTestAbstract::vpMeanDriftType | vpMeanDriftType |
Public Member Functions | |
vpStatisticalTestAbstract () | |
vpStatisticalTestAbstract (const vpStatisticalTestAbstract &other) | |
virtual | ~vpStatisticalTestAbstract () |
void | getLimits (float &limitDown, float &limitUp) const |
float | getMean () const |
float | getStdev () const |
void | init () |
vpStatisticalTestAbstract & | operator= (const vpStatisticalTestAbstract &other) |
void | setMinStdev (const float &stdevmin) |
void | setNbSamplesForStat (const unsigned int &nbSamples) |
vpMeanDriftType | testDownUpwardMeanDrift (const float &signal) |
vpMeanDriftType | testDownwardMeanDrift (const float &signal) |
vpMeanDriftType | testUpwardMeanDrift (const float &signal) |
Static Public Member Functions | |
static std::string | vpMeanDriftTypeToString (const vpMeanDriftType &type) |
static vpMeanDriftType | vpMeanDriftTypeFromString (const std::string &name) |
static std::string | getAvailableMeanDriftType (const std::string &prefix="<", const std::string &sep=" , ", const std::string &suffix=">") |
static void | print (const vpMeanDriftType &type) |
Protected Member Functions | |
virtual vpMeanDriftType | detectDownwardMeanDrift ()=0 |
virtual vpMeanDriftType | detectUpwardMeanDrift ()=0 |
virtual bool | updateStatistics (const float &signal) |
virtual void | updateTestSignals (const float &signal)=0 |
Protected Attributes | |
bool | m_areStatisticsComputed |
float | m_count |
float | m_limitDown |
float | m_limitUp |
float | m_mean |
unsigned int | m_nbSamplesForStatistics |
float * | m_s |
float | m_stdev |
float | m_stdevmin |
float | m_sumForMean |
Base class for methods detecting the drift of the mean of a process.
To detect only downward drifts of the input signal use testDownwardMeanDrift().To detect only upward drifts in use testUpwardMeanDrift(). To detect both, downward and upward drifts use testDownUpwardMeanDrift().
Definition at line 57 of file vpStatisticalTestAbstract.h.
Enum that indicates if a drift of the mean occurred.
Enum that indicates if a drift of the mean occurred.
Definition at line 63 of file vpStatisticalTestAbstract.h.
vpStatisticalTestAbstract::vpStatisticalTestAbstract | ( | ) |
Construct a new vpStatisticalTestAbstract object.
Definition at line 128 of file vpStatisticalTestAbstract.cpp.
vpStatisticalTestAbstract::vpStatisticalTestAbstract | ( | const vpStatisticalTestAbstract & | other | ) |
Construct by copy a new vpStatisticalTestAbstract object.
Definition at line 141 of file vpStatisticalTestAbstract.cpp.
|
virtual |
Destroy the vpStatisticalTestAbstract object.
Definition at line 146 of file vpStatisticalTestAbstract.cpp.
References m_s.
|
protectedpure virtual |
Detects if a downward mean drift occurred.
Implemented in vpStatisticalTestSigma, vpStatisticalTestShewhart, vpStatisticalTestMeanAdjustedCUSUM, vpStatisticalTestHinkley, and vpStatisticalTestEWMA.
Referenced by testDownUpwardMeanDrift(), and testDownwardMeanDrift().
|
protectedpure virtual |
Detects if a upward mean drift occurred.
Implemented in vpStatisticalTestSigma, vpStatisticalTestShewhart, vpStatisticalTestMeanAdjustedCUSUM, vpStatisticalTestHinkley, and vpStatisticalTestEWMA.
Referenced by testDownUpwardMeanDrift(), and testUpwardMeanDrift().
|
static |
Get the list of available vpMeanDriftType objects that are handled.
[in] | prefix | The prefix that should be placed before the list. |
[in] | sep | The separator between each element of the list. |
[in] | suffix | The suffix that should terminate the list. |
Definition at line 82 of file vpStatisticalTestAbstract.cpp.
References MEAN_DRIFT_COUNT, and vpMeanDriftTypeToString().
|
inline |
Get the upper and lower limits of the test signal.
[out] | limitDown | The lower limit. |
[out] | limitUp | The upper limit. |
Definition at line 175 of file vpStatisticalTestAbstract.h.
|
inline |
Get the mean used as reference.
Definition at line 186 of file vpStatisticalTestAbstract.h.
|
inline |
Get the standard deviation used as reference.
Definition at line 196 of file vpStatisticalTestAbstract.h.
void vpStatisticalTestAbstract::init | ( | ) |
(Re)Initialize the algorithm.
Definition at line 154 of file vpStatisticalTestAbstract.cpp.
References m_areStatisticsComputed, m_count, m_limitDown, m_limitUp, m_mean, m_nbSamplesForStatistics, m_s, m_stdev, and m_sumForMean.
Referenced by vpStatisticalTestHinkley::init(), vpStatisticalTestShewhart::init(), vpStatisticalTestEWMA::init(), vpStatisticalTestMeanAdjustedCUSUM::init(), vpStatisticalTestSigma::init(), vpStatisticalTestEWMA::setAlpha(), vpStatisticalTestEWMA::vpStatisticalTestEWMA(), vpStatisticalTestMeanAdjustedCUSUM::vpStatisticalTestMeanAdjustedCUSUM(), vpStatisticalTestShewhart::vpStatisticalTestShewhart(), and vpStatisticalTestSigma::vpStatisticalTestSigma().
vpStatisticalTestAbstract & vpStatisticalTestAbstract::operator= | ( | const vpStatisticalTestAbstract & | other | ) |
Copy operator of a vpStatisticalTestAbstract.
[in] | other | The vpStatisticalTestAbstract to copy. |
Definition at line 170 of file vpStatisticalTestAbstract.cpp.
References m_areStatisticsComputed, m_count, m_limitDown, m_limitUp, m_mean, m_nbSamplesForStatistics, m_s, m_stdev, m_sumForMean, and setNbSamplesForStat().
|
static |
Print the message corresponding to the type of mean drift.
[in] | type | The type of mean drift. |
Definition at line 95 of file vpStatisticalTestAbstract.cpp.
References vpMeanDriftTypeToString().
|
inline |
Set the minimum value of the standard deviation that is expected. The computed standard deviation cannot be lower this value if set.
[in] | stdevmin | The minimum value of the standard deviation that is expected. |
Definition at line 220 of file vpStatisticalTestAbstract.h.
void vpStatisticalTestAbstract::setNbSamplesForStat | ( | const unsigned int & | nbSamples | ) |
Set the number of samples required to compute the mean and standard deviation of the signal and allocate the memory accordingly.
[in] | nbSamples | The number of samples we want to use. |
Definition at line 190 of file vpStatisticalTestAbstract.cpp.
References m_nbSamplesForStatistics, and m_s.
Referenced by vpStatisticalTestHinkley::init(), vpStatisticalTestEWMA::init(), vpStatisticalTestMeanAdjustedCUSUM::init(), vpStatisticalTestSigma::init(), and operator=().
vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestAbstract::testDownUpwardMeanDrift | ( | const float & | signal | ) |
Test if a downward or an upward mean drift occurred according to the new value of the signal.
[in] | signal | The new value of the signal. |
Definition at line 199 of file vpStatisticalTestAbstract.cpp.
References detectDownwardMeanDrift(), detectUpwardMeanDrift(), m_areStatisticsComputed, MEAN_DRIFT_BOTH, MEAN_DRIFT_NONE, updateStatistics(), and updateTestSignals().
vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestAbstract::testDownwardMeanDrift | ( | const float & | signal | ) |
Test if a downward mean drift occurred according to the new value of the signal.
[in] | signal | The new value of the signal. |
Definition at line 224 of file vpStatisticalTestAbstract.cpp.
References detectDownwardMeanDrift(), m_areStatisticsComputed, MEAN_DRIFT_NONE, updateStatistics(), and updateTestSignals().
vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestAbstract::testUpwardMeanDrift | ( | const float & | signal | ) |
Test if an upward mean drift occurred according to the new value of the signal.
[in] | signal | The new value of the signal. |
Definition at line 236 of file vpStatisticalTestAbstract.cpp.
References detectUpwardMeanDrift(), m_areStatisticsComputed, MEAN_DRIFT_NONE, updateStatistics(), and updateTestSignals().
|
protectedvirtual |
Update m_s and if enough values are available, compute the mean, the standard deviation and the limits.
[in] | signal | The new value of the signal to monitor. |
Reimplemented in vpStatisticalTestSigma, vpStatisticalTestShewhart, vpStatisticalTestMeanAdjustedCUSUM, vpStatisticalTestHinkley, and vpStatisticalTestEWMA.
Definition at line 100 of file vpStatisticalTestAbstract.cpp.
References m_areStatisticsComputed, m_count, m_mean, m_nbSamplesForStatistics, m_s, m_stdev, m_stdevmin, and m_sumForMean.
Referenced by testDownUpwardMeanDrift(), testDownwardMeanDrift(), testUpwardMeanDrift(), vpStatisticalTestEWMA::updateStatistics(), vpStatisticalTestHinkley::updateStatistics(), vpStatisticalTestMeanAdjustedCUSUM::updateStatistics(), vpStatisticalTestShewhart::updateStatistics(), and vpStatisticalTestSigma::updateStatistics().
|
protectedpure virtual |
Update the test signals.
[in] | signal | The new value of the signal to monitor. |
Implemented in vpStatisticalTestSigma, vpStatisticalTestShewhart, vpStatisticalTestMeanAdjustedCUSUM, vpStatisticalTestHinkley, and vpStatisticalTestEWMA.
Referenced by testDownUpwardMeanDrift(), testDownwardMeanDrift(), and testUpwardMeanDrift().
|
static |
Cast a string into a vpMeanDriftType.
[in] | name | The name of the mean drift. |
Definition at line 65 of file vpStatisticalTestAbstract.cpp.
References MEAN_DRIFT_COUNT, MEAN_DRIFT_UNKNOWN, and vpMeanDriftTypeToString().
|
static |
Cast a vpMeanDriftType into a string.
[in] | type | The type of mean drift. |
Definition at line 41 of file vpStatisticalTestAbstract.cpp.
References MEAN_DRIFT_BOTH, MEAN_DRIFT_DOWNWARD, MEAN_DRIFT_NONE, MEAN_DRIFT_UNKNOWN, and MEAN_DRIFT_UPWARD.
Referenced by getAvailableMeanDriftType(), print(), and vpMeanDriftTypeFromString().
|
protected |
Set to true once the mean and the standard deviation are available.
Definition at line 108 of file vpStatisticalTestAbstract.h.
Referenced by init(), vpStatisticalTestShewhart::init(), vpStatisticalTestHinkley::init(), vpStatisticalTestEWMA::init(), vpStatisticalTestMeanAdjustedCUSUM::init(), vpStatisticalTestSigma::init(), operator=(), testDownUpwardMeanDrift(), testDownwardMeanDrift(), testUpwardMeanDrift(), updateStatistics(), and vpStatisticalTestHinkley::updateStatistics().
|
protected |
Current number of data used to compute the mean and the standard deviation.
Definition at line 109 of file vpStatisticalTestAbstract.h.
Referenced by vpStatisticalTestHinkley::computeMean(), init(), operator=(), updateStatistics(), and vpStatisticalTestHinkley::updateTestSignals().
|
protected |
Upper limit for the test signal m_wt.
Definition at line 110 of file vpStatisticalTestAbstract.h.
Referenced by vpStatisticalTestEWMA::computeDeltaAndLimits(), vpStatisticalTestSigma::computeLimits(), vpStatisticalTestShewhart::computeLimits(), vpStatisticalTestEWMA::detectDownwardMeanDrift(), vpStatisticalTestMeanAdjustedCUSUM::detectDownwardMeanDrift(), vpStatisticalTestShewhart::detectDownwardMeanDrift(), vpStatisticalTestSigma::detectDownwardMeanDrift(), init(), operator=(), vpStatisticalTestHinkley::setAlpha(), and vpStatisticalTestMeanAdjustedCUSUM::updateStatistics().
|
protected |
Lower limit for the test signal m_wt
Definition at line 111 of file vpStatisticalTestAbstract.h.
Referenced by vpStatisticalTestEWMA::computeDeltaAndLimits(), vpStatisticalTestSigma::computeLimits(), vpStatisticalTestShewhart::computeLimits(), vpStatisticalTestEWMA::detectUpwardMeanDrift(), vpStatisticalTestMeanAdjustedCUSUM::detectUpwardMeanDrift(), vpStatisticalTestShewhart::detectUpwardMeanDrift(), vpStatisticalTestSigma::detectUpwardMeanDrift(), init(), operator=(), vpStatisticalTestHinkley::setAlpha(), and vpStatisticalTestMeanAdjustedCUSUM::updateStatistics().
|
protected |
Mean of the monitored signal.
Definition at line 112 of file vpStatisticalTestAbstract.h.
Referenced by vpStatisticalTestEWMA::computeDeltaAndLimits(), vpStatisticalTestSigma::computeLimits(), vpStatisticalTestShewhart::computeLimits(), vpStatisticalTestHinkley::computeMean(), vpStatisticalTestHinkley::computeSk(), vpStatisticalTestHinkley::computeTk(), vpStatisticalTestShewhart::detectDownwardMeanDrift(), vpStatisticalTestShewhart::detectUpwardMeanDrift(), init(), vpStatisticalTestShewhart::init(), vpStatisticalTestHinkley::init(), vpStatisticalTestEWMA::init(), vpStatisticalTestMeanAdjustedCUSUM::init(), vpStatisticalTestSigma::init(), operator=(), updateStatistics(), vpStatisticalTestEWMA::updateStatistics(), and vpStatisticalTestMeanAdjustedCUSUM::updateTestSignals().
|
protected |
Number of samples to use to compute the mean and the standard deviation.
Definition at line 113 of file vpStatisticalTestAbstract.h.
Referenced by init(), operator=(), setNbSamplesForStat(), and updateStatistics().
|
protected |
Array that keeps the samples used to compute the mean and standard deviation.
Definition at line 114 of file vpStatisticalTestAbstract.h.
Referenced by vpStatisticalTestSigma::getSignal(), init(), operator=(), setNbSamplesForStat(), updateStatistics(), and ~vpStatisticalTestAbstract().
|
protected |
Standard deviation of the monitored signal.
Definition at line 115 of file vpStatisticalTestAbstract.h.
Referenced by vpStatisticalTestHinkley::computeAlphaDelta(), vpStatisticalTestEWMA::computeDeltaAndLimits(), vpStatisticalTestMeanAdjustedCUSUM::computeDeltaAndLimits(), vpStatisticalTestSigma::computeLimits(), vpStatisticalTestShewhart::computeLimits(), init(), vpStatisticalTestShewhart::init(), vpStatisticalTestEWMA::init(), vpStatisticalTestHinkley::init(), vpStatisticalTestMeanAdjustedCUSUM::init(), vpStatisticalTestSigma::init(), operator=(), and updateStatistics().
|
protected |
Minimum allowed standard deviation of the monitored signal.
Definition at line 116 of file vpStatisticalTestAbstract.h.
Referenced by updateStatistics().
|
protected |
Sum of the samples used to compute the mean and standard deviation.
Definition at line 117 of file vpStatisticalTestAbstract.h.
Referenced by init(), vpStatisticalTestMeanAdjustedCUSUM::init(), operator=(), and updateStatistics().