Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpStatisticalTestHinkley Class Reference

#include <vpStatisticalTestHinkley.h>

Inheritance diagram for vpStatisticalTestHinkley:

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

 vpStatisticalTestHinkley ()
 vpStatisticalTestHinkley (const float &alpha, const float &delta, const unsigned int &nbSamplesForInit=30)
 vpStatisticalTestHinkley (const float &h, const float &k, const bool &computeAlphaDeltaFromStdev, const unsigned int &nbSamplesForInit=30)
 vpStatisticalTestHinkley (const float &h, const float &k, const float &mean, const float &stdev)
float getAlpha () const
float getSk () const
float getMk () const
float getTk () const
float getNk () const
void init ()
void init (const float &alpha, const float &delta, const unsigned int &nbSamplesForInit)
void init (const float &h, const float &k, const bool &computeAlphaDeltaFromStdev, const unsigned int &nbSamplesForInit)
void init (const float &alpha, const float &delta, const float &mean)
void init (const float &h, const float &k, const float &mean, const float &stdev)
void setDelta (const float &delta)
void setAlpha (const float &alpha)
void getLimits (float &limitDown, float &limitUp) const
float getMean () const
float getStdev () const
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 void computeAlphaDelta ()
void computeMean (double signal)
void computeSk (double signal)
void computeMk ()
void computeTk (double signal)
void computeNk ()
virtual vpMeanDriftType detectDownwardMeanDrift () VP_OVERRIDE
virtual vpMeanDriftType detectUpwardMeanDrift () VP_OVERRIDE
virtual bool updateStatistics (const float &signal) VP_OVERRIDE
virtual void updateTestSignals (const float &signal) VP_OVERRIDE

Protected Attributes

float m_dmin2
float m_alpha
float m_Sk
float m_Mk
float m_Tk
float m_Nk
bool m_computeDeltaAndAlpha
float m_h
float m_k
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

Detailed Description

This class implements the Hinkley's cumulative sum test.

The Hinkley's cumulative sum test is designed to detect drift in the mean of an observed signal $ s(t) $. It is known to be robust (by taking into account all the past of the observed quantity), efficient, and inducing a very low computational load. The other attractive features of this test are two-fold. First, it can straightforwardly and accurately provide the drift instant. Secondly, due to its formulation (cumulative sum test), it can simultaneously handle both very abrupt and important changes, and gradual smaller ones without adapting the involved thresholds.

Two tests are performed in parallel to look for downwards or upwards drifts in $ s(t) $, respectively defined by:

\‍[ S_k = \sum_{t=0}^{k} (s(t) - m_0 + \frac{\delta}{2}) \‍]

\‍[ M_k = \max_{0 \leq i \leq k} S_i\‍]

\‍[ T_k = \sum_{t=0}^{k} (s(t) - m_0 - \frac{\delta}{2}) \‍]

\‍[ N_k = \min_{0 \leq i \leq k} T_i\‍]

In which $m_o$ is computed on-line and corresponds to the mean of the signal $ s(t) $ we want to detect a drift. $m_o$ is re-initialized at zero after each drift detection. $\delta$ denotes the drift minimal magnitude that we want to detect and $\alpha$ is a predefined threshold. These values are set by default to 0.2 in the default constructor vpStatisticalTestHinkley(). To modify the default values use setAlpha() and setDelta() or the vpStatisticalTestHinkley(double alpha, double delta) constructor.

A downward drift is detected if $ M_k - S_k > \alpha $. A upward drift is detected if $ T_k - N_k > \alpha $.

To detect only downward drifts in $ s(t) $ use testDownwardMeanDrift().To detect only upward drifts in $ s(t) $ use testUpwardMeanDrift(). To detect both, downward and upward drifts use testDownUpwardMeanDrift().

If a drift is detected, the drift location is given by the last instant $k^{'}$ when $ M_{k^{'}} - S_{k^{'}} = 0 $, or $ T_{k^{'}} -
N_{k^{'}} = 0 $.

Tutorials & Examples

Tutorials
If you are interested in using Statistical Process Control methods, you may have a look at:

Examples
testSPC.cpp, and tutorial-meandrift.cpp.

Definition at line 94 of file vpStatisticalTestHinkley.h.

Member Typedef Documentation

◆ vpMeanDriftType

Enum that indicates if a drift of the mean occurred.

Member Enumeration Documentation

◆ vpMeanDriftType

Enum that indicates if a drift of the mean occurred.

Enumerator
MEAN_DRIFT_NONE 

No mean drift occurred

MEAN_DRIFT_DOWNWARD 

A downward drift of the mean occurred.

MEAN_DRIFT_UPWARD 

An upward drift of the mean occurred.

MEAN_DRIFT_BOTH 

Both an aupward and a downward drifts occurred.

MEAN_DRIFT_COUNT 
MEAN_DRIFT_UNKNOWN 
Examples
testSPC.cpp, and tutorial-meandrift.cpp.

Definition at line 69 of file vpStatisticalTestAbstract.h.

Constructor & Destructor Documentation

◆ vpStatisticalTestHinkley() [1/4]

BEGIN_VISP_NAMESPACE vpStatisticalTestHinkley::vpStatisticalTestHinkley ( )

Construct a new vpStatisticalTestHinkley object. Call init() to initialise the Hinkley's test and set $\alpha$ and $\delta$ to default values.

By default $ \delta = 0.2 $ and $ \alpha = 0.2$. Use setDelta() and setAlpha() to modify these values.

Definition at line 49 of file vpStatisticalTestHinkley.cpp.

References init(), m_alpha, m_computeDeltaAndAlpha, m_dmin2, m_h, m_k, m_Mk, m_Nk, m_Sk, m_Tk, and vpStatisticalTestAbstract::vpStatisticalTestAbstract().

◆ vpStatisticalTestHinkley() [2/4]

vpStatisticalTestHinkley::vpStatisticalTestHinkley ( const float & alpha,
const float & delta,
const unsigned int & nbSamplesForInit = 30 )

Call init() to initialise the Hinkley's test and set $\alpha$ and $\delta$ thresholds.

Parameters
[in]alpha: $\alpha$ threshold indicating that a mean drift occurs.
[in]delta: $\delta$ denotes the drift minimal magnitude that we want to detect.
[in]nbSamplesForInit: number of signal samples to initialize the mean of the signal.
See also
setAlpha(), setDelta()

Definition at line 64 of file vpStatisticalTestHinkley.cpp.

References init(), m_alpha, m_computeDeltaAndAlpha, m_dmin2, m_h, m_k, m_Mk, m_Nk, m_Sk, m_Tk, and vpStatisticalTestAbstract::vpStatisticalTestAbstract().

◆ vpStatisticalTestHinkley() [3/4]

vpStatisticalTestHinkley::vpStatisticalTestHinkley ( const float & h,
const float & k,
const bool & computeAlphaDeltaFromStdev,
const unsigned int & nbSamplesForInit = 30 )

Construct a new vpStatisticalTestHinkley object. $\alpha$ and $\delta$ will be computed from the standard deviation of the signal.

Parameters
[in]h: the alarm factor that permits to compute $\alpha$ from the standard deviation.
[in]k: the detection factor that permits to compute $\delta$ from the standard deviation.
[in]computeAlphaDeltaFromStdev: must be equal to true, otherwise throw a vpException.
[in]nbSamplesForInit: number of signal samples to initialize the mean of the signal.

Definition at line 79 of file vpStatisticalTestHinkley.cpp.

References init(), and vpStatisticalTestAbstract::vpStatisticalTestAbstract().

◆ vpStatisticalTestHinkley() [4/4]

vpStatisticalTestHinkley::vpStatisticalTestHinkley ( const float & h,
const float & k,
const float & mean,
const float & stdev )

Construct a new vpStatisticalTestHinkley object. $\alpha$ and $\delta$ will be computed from the standard deviation of the signal.

Parameters
[in]h: the alarm factor that permits to compute $\alpha$ from the standard deviation.
[in]k: the detection factor that permits to compute $\delta$ from the standard deviation.
[in]mean: the expected mean of the signal.
[in]stdev: the expected standard deviation of the signal.

Definition at line 85 of file vpStatisticalTestHinkley.cpp.

References init(), and vpStatisticalTestAbstract::vpStatisticalTestAbstract().

Member Function Documentation

◆ computeAlphaDelta()

void vpStatisticalTestHinkley::computeAlphaDelta ( )
protectedvirtual

Compute $\delta$ and $\alpha$ from the standard deviation of the signal.

Definition at line 158 of file vpStatisticalTestHinkley.cpp.

References m_h, m_k, vpStatisticalTestAbstract::m_stdev, setAlpha(), and setDelta().

Referenced by init(), and updateStatistics().

◆ computeMean()

void vpStatisticalTestHinkley::computeMean ( double signal)
protected

Compute the mean value $m_0$ of the signal. The mean value must be computed before the mean drift is estimated on-line.

Parameters
[in]signalThe new value of the signal to monitor.

Definition at line 166 of file vpStatisticalTestHinkley.cpp.

References vpStatisticalTestAbstract::m_count, vpStatisticalTestAbstract::m_mean, m_Mk, m_Nk, m_Sk, m_Tk, and vpMath::maximum().

Referenced by updateTestSignals().

◆ computeMk()

void vpStatisticalTestHinkley::computeMk ( )
protected

Compute $M_k$, the maximum value of $S_k$.

Definition at line 184 of file vpStatisticalTestHinkley.cpp.

References m_Mk, and m_Sk.

Referenced by updateTestSignals().

◆ computeNk()

void vpStatisticalTestHinkley::computeNk ( )
protected

Compute $N_k$, the minimum value of $T_k$.

Definition at line 196 of file vpStatisticalTestHinkley.cpp.

References m_Nk, and m_Tk.

Referenced by updateTestSignals().

◆ computeSk()

void vpStatisticalTestHinkley::computeSk ( double signal)
protected

Compute $S_k = \sum_{t=0}^{k} (s(t) - m_0 + \frac{\delta}{2})$.

Parameters
[in]signalThe new value of the signal to monitor.

Definition at line 179 of file vpStatisticalTestHinkley.cpp.

References m_dmin2, vpStatisticalTestAbstract::m_mean, and m_Sk.

Referenced by updateTestSignals().

◆ computeTk()

void vpStatisticalTestHinkley::computeTk ( double signal)
protected

Compute $T_k = \sum_{t=0}^{k} (s(t) - m_0 - \frac{\delta}{2})$.

Parameters
[in]signalThe new value of the signal to monitor.

Definition at line 191 of file vpStatisticalTestHinkley.cpp.

References m_dmin2, vpStatisticalTestAbstract::m_mean, and m_Tk.

Referenced by updateTestSignals().

◆ detectDownwardMeanDrift()

vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestHinkley::detectDownwardMeanDrift ( )
protectedvirtual

Detects if a downward mean drift occurred.

Returns
vpMeanDriftType::MEAN_DRIFT_DOWNWARD if a downward mean drift occurred, vpMeanDriftType::MEAN_DRIFT_NONE otherwise.

Implements vpStatisticalTestAbstract.

Definition at line 203 of file vpStatisticalTestHinkley.cpp.

References m_alpha, m_Mk, m_Sk, vpStatisticalTestAbstract::MEAN_DRIFT_DOWNWARD, and vpStatisticalTestAbstract::MEAN_DRIFT_NONE.

◆ detectUpwardMeanDrift()

vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestHinkley::detectUpwardMeanDrift ( )
protectedvirtual

Detects if an upward mean drift occurred on the mean.

Returns
vpMeanDriftType::MEAN_DRIFT_UPWARD if an upward mean drift occurred, vpMeanDriftType::MEAN_DRIFT_NONE otherwise.
See also
detectDownwardMeanDrift()

Implements vpStatisticalTestAbstract.

Definition at line 212 of file vpStatisticalTestHinkley.cpp.

References m_alpha, m_Nk, m_Tk, vpStatisticalTestAbstract::MEAN_DRIFT_NONE, and vpStatisticalTestAbstract::MEAN_DRIFT_UPWARD.

◆ getAlpha()

float vpStatisticalTestHinkley::getAlpha ( ) const
inline

Get the $\alpha$ threshold indicating that a mean drift occurs.

Returns
The $\alpha$ threshold.

Definition at line 226 of file vpStatisticalTestHinkley.h.

References getAlpha(), and m_alpha.

Referenced by getAlpha().

◆ getAvailableMeanDriftType()

std::string vpStatisticalTestAbstract::getAvailableMeanDriftType ( const std::string & prefix = "<",
const std::string & sep = " , ",
const std::string & suffix = ">" )
staticinherited

Get the list of available vpMeanDriftType objects that are handled.

Parameters
[in]prefixThe prefix that should be placed before the list.
[in]sepThe separator between each element of the list.
[in]suffixThe suffix that should terminate the list.
Returns
std::string The list of handled type of process tests, presented as a string.
Examples
tutorial-meandrift.cpp.

Definition at line 85 of file vpStatisticalTestAbstract.cpp.

References MEAN_DRIFT_COUNT, and vpMeanDriftTypeToString().

◆ getLimits()

void vpStatisticalTestAbstract::getLimits ( float & limitDown,
float & limitUp ) const
inlineinherited

Get the upper and lower limits of the test signal.

Parameters
[out]limitDownThe lower limit.
[out]limitUpThe upper limit.
Examples
testSPC.cpp, and tutorial-meandrift.cpp.

Definition at line 181 of file vpStatisticalTestAbstract.h.

References m_limitDown, and m_limitUp.

◆ getMean()

float vpStatisticalTestAbstract::getMean ( ) const
inlineinherited

Get the mean used as reference.

Returns
float The mean.
Examples
tutorial-meandrift.cpp.

Definition at line 192 of file vpStatisticalTestAbstract.h.

References m_mean.

◆ getMk()

float vpStatisticalTestHinkley::getMk ( ) const
inline

Get the maximum of the test signal for downward mean drift $S_k$ .

Returns
The value of $M_k$, the maximum value of $S_k$.
Examples
tutorial-meandrift.cpp.

Definition at line 240 of file vpStatisticalTestHinkley.h.

References m_Mk.

◆ getNk()

float vpStatisticalTestHinkley::getNk ( ) const
inline

Get the minimum of the test signal for upward mean drift $T_k$.

Returns
The value of $N_k$, the minimum value of $T_k$.
Examples
tutorial-meandrift.cpp.

Definition at line 255 of file vpStatisticalTestHinkley.h.

References m_Nk.

◆ getSk()

float vpStatisticalTestHinkley::getSk ( ) const
inline

Get the test signal for downward mean drift.

Returns
The value of $S_k = \sum_{t=0}^{k} (s(t) - m_0 + \frac{\delta}{2})$ .
Examples
tutorial-meandrift.cpp.

Definition at line 233 of file vpStatisticalTestHinkley.h.

References m_Sk.

◆ getStdev()

float vpStatisticalTestAbstract::getStdev ( ) const
inlineinherited

Get the standard deviation used as reference.

Returns
float The standard deviation.
Examples
tutorial-meandrift.cpp.

Definition at line 202 of file vpStatisticalTestAbstract.h.

References m_stdev.

◆ getTk()

float vpStatisticalTestHinkley::getTk ( ) const
inline

Get the test signal for upward mean drift..

Returns
The value of $T_k = \sum_{t=0}^{k} (s(t) - m_0 - \frac{\delta}{2})$ .
Examples
tutorial-meandrift.cpp.

Definition at line 248 of file vpStatisticalTestHinkley.h.

References m_Tk.

◆ init() [1/5]

void vpStatisticalTestHinkley::init ( )

◆ init() [2/5]

void vpStatisticalTestHinkley::init ( const float & alpha,
const float & delta,
const float & mean )

Call init() to initialise the Hinkley's test, set $\alpha$ and $\delta$ thresholds, and the mean of the signal $m_0$.

Parameters
[in]alphaThe threshold indicating that a mean drift occurs.
[in]deltaThe drift minimal magnitude that we want to detect.
[in]meanThe expected value of the mean.

Definition at line 115 of file vpStatisticalTestHinkley.cpp.

References init(), vpStatisticalTestAbstract::m_areStatisticsComputed, m_computeDeltaAndAlpha, vpStatisticalTestAbstract::m_mean, setAlpha(), and setDelta().

◆ init() [3/5]

void vpStatisticalTestHinkley::init ( const float & alpha,
const float & delta,
const unsigned int & nbSamplesForInit )

Call init() to initialise the Hinkley's test and set $\alpha$ and $\delta$ thresholds.

Parameters
[in]alphaThe threshold indicating that a mean drift occurs.
[in]deltaThe drift minimal magnitude that we want to detect.
[in]nbSamplesForInit: number of signal samples to initialize the mean of the signal.

Definition at line 106 of file vpStatisticalTestHinkley.cpp.

References init(), m_computeDeltaAndAlpha, setAlpha(), setDelta(), and vpStatisticalTestAbstract::setNbSamplesForStat().

◆ init() [4/5]

void vpStatisticalTestHinkley::init ( const float & h,
const float & k,
const bool & computeAlphaDeltaFromStdev,
const unsigned int & nbSamplesForInit )

(Re)Initialize a new vpStatisticalTestHinkley object. $\alpha$ and $\delta$ will be computed from the standard deviation of the signal.

Parameters
[in]h: the alarm factor that permits to compute $\alpha$ from the standard deviation.
[in]k: the detection factor that permits to compute $\delta$ from the standard deviation.
[in]computeAlphaDeltaFromStdev: must be equal to true, otherwise throw a vpException.
[in]nbSamplesForInit: number of signal samples to initialize the mean of the signal.

Definition at line 125 of file vpStatisticalTestHinkley.cpp.

References vpException::badValue, init(), m_computeDeltaAndAlpha, m_h, m_k, and vpStatisticalTestAbstract::setNbSamplesForStat().

◆ init() [5/5]

void vpStatisticalTestHinkley::init ( const float & h,
const float & k,
const float & mean,
const float & stdev )

(Re)Initialize a new vpStatisticalTestHinkley object. $\alpha$ and $\delta$ will be computed from the standard deviation of the signal.

Parameters
[in]h: the alarm factor that permits to compute $\alpha$ from the standard deviation.
[in]k: the detection factor that permits to compute $\delta$ from the standard deviation.
[in]mean: the expected mean of the signal.
[in]stdev: the expected standard deviation of the signal.

Definition at line 137 of file vpStatisticalTestHinkley.cpp.

References computeAlphaDelta(), init(), vpStatisticalTestAbstract::m_areStatisticsComputed, m_computeDeltaAndAlpha, m_h, m_k, vpStatisticalTestAbstract::m_mean, and vpStatisticalTestAbstract::m_stdev.

◆ print()

void vpStatisticalTestAbstract::print ( const vpMeanDriftType & type)
staticinherited

Print the message corresponding to the type of mean drift.

Parameters
[in]typeThe type of mean drift.

Definition at line 98 of file vpStatisticalTestAbstract.cpp.

References vpMeanDriftTypeToString().

◆ setAlpha()

void vpStatisticalTestHinkley::setAlpha ( const float & alpha)

The threshold indicating that a mean drift occurs.

Parameters
[in]alphaThe threshold.

Definition at line 151 of file vpStatisticalTestHinkley.cpp.

References m_alpha, vpStatisticalTestAbstract::m_limitDown, and vpStatisticalTestAbstract::m_limitUp.

Referenced by computeAlphaDelta(), init(), init(), and init().

◆ setDelta()

void vpStatisticalTestHinkley::setDelta ( const float & delta)

Set the drift minimal magnitude that we want to detect.

Parameters
[in]deltaThe drift magnitude.

Definition at line 149 of file vpStatisticalTestHinkley.cpp.

References m_dmin2.

Referenced by computeAlphaDelta(), init(), and init().

◆ setMinStdev()

void vpStatisticalTestAbstract::setMinStdev ( const float & stdevmin)
inlineinherited

Set the minimum value of the standard deviation that is expected. The computed standard deviation cannot be lower this value if set.

Parameters
[in]stdevminThe minimum value of the standard deviation that is expected.

Definition at line 226 of file vpStatisticalTestAbstract.h.

References m_stdevmin.

◆ setNbSamplesForStat()

void vpStatisticalTestAbstract::setNbSamplesForStat ( const unsigned int & nbSamples)
inherited

Set the number of samples required to compute the mean and standard deviation of the signal and allocate the memory accordingly.

Parameters
[in]nbSamplesThe number of samples we want to use.

Definition at line 193 of file vpStatisticalTestAbstract.cpp.

References m_nbSamplesForStatistics, and m_s.

Referenced by vpStatisticalTestEWMA::init(), vpStatisticalTestEWMA::init(), vpStatisticalTestHinkley::init(), vpStatisticalTestHinkley::init(), vpStatisticalTestHinkley::init(), vpStatisticalTestMeanAdjustedCUSUM::init(), vpStatisticalTestMeanAdjustedCUSUM::init(), vpStatisticalTestSigma::init(), and operator=().

◆ testDownUpwardMeanDrift()

vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestAbstract::testDownUpwardMeanDrift ( const float & signal)
inherited

Test if a downward or an upward mean drift occurred according to the new value of the signal.

Parameters
[in]signalThe new value of the signal.
Returns
vpMeanDriftType The type of mean drift that occurred.
See also
testDownwardMeanDrift() testUpwardMeanDrift()
Examples
testSPC.cpp, and tutorial-meandrift.cpp.

Definition at line 202 of file vpStatisticalTestAbstract.cpp.

References detectDownwardMeanDrift(), detectUpwardMeanDrift(), m_areStatisticsComputed, MEAN_DRIFT_BOTH, MEAN_DRIFT_NONE, updateStatistics(), and updateTestSignals().

◆ testDownwardMeanDrift()

vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestAbstract::testDownwardMeanDrift ( const float & signal)
inherited

Test if a downward mean drift occurred according to the new value of the signal.

Parameters
[in]signalThe new value of the signal.
Returns
vpMeanDriftType The type of mean drift that occurred.
See also
testUpwardMeanDrift()

Definition at line 227 of file vpStatisticalTestAbstract.cpp.

References detectDownwardMeanDrift(), m_areStatisticsComputed, MEAN_DRIFT_NONE, updateStatistics(), and updateTestSignals().

◆ testUpwardMeanDrift()

vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestAbstract::testUpwardMeanDrift ( const float & signal)
inherited

Test if an upward mean drift occurred according to the new value of the signal.

Parameters
[in]signalThe new value of the signal.
Returns
vpMeanDriftType The type of mean drift that occurred.
See also
testDownwardMeanDrift()

Definition at line 239 of file vpStatisticalTestAbstract.cpp.

References detectUpwardMeanDrift(), m_areStatisticsComputed, MEAN_DRIFT_NONE, updateStatistics(), and updateTestSignals().

◆ updateStatistics()

bool vpStatisticalTestHinkley::updateStatistics ( const float & signal)
protectedvirtual

Update m_s and if enough values are available, compute the mean, the standard deviation and the limits.

Parameters
[in]signalThe new value of the signal to monitor.

Reimplemented from vpStatisticalTestAbstract.

Definition at line 221 of file vpStatisticalTestHinkley.cpp.

References computeAlphaDelta(), vpStatisticalTestAbstract::m_areStatisticsComputed, m_computeDeltaAndAlpha, m_Mk, m_Nk, m_Sk, m_Tk, and vpStatisticalTestAbstract::updateStatistics().

◆ updateTestSignals()

void vpStatisticalTestHinkley::updateTestSignals ( const float & signal)
protectedvirtual

Update the test signals.

Parameters
[in]signalThe new value of the signal to monitor.

Implements vpStatisticalTestAbstract.

Definition at line 238 of file vpStatisticalTestHinkley.cpp.

References computeMean(), computeMk(), computeNk(), computeSk(), computeTk(), and vpStatisticalTestAbstract::m_count.

◆ vpMeanDriftTypeFromString()

vpStatisticalTestAbstract::vpMeanDriftType vpStatisticalTestAbstract::vpMeanDriftTypeFromString ( const std::string & name)
staticinherited

Cast a string into a vpMeanDriftType.

Parameters
[in]nameThe name of the mean drift.
Returns
vpMeanDriftType The corresponding vpMeanDriftType.
Examples
tutorial-meandrift.cpp.

Definition at line 68 of file vpStatisticalTestAbstract.cpp.

References MEAN_DRIFT_COUNT, MEAN_DRIFT_UNKNOWN, and vpMeanDriftTypeToString().

◆ vpMeanDriftTypeToString()

BEGIN_VISP_NAMESPACE std::string vpStatisticalTestAbstract::vpMeanDriftTypeToString ( const vpMeanDriftType & type)
staticinherited

Cast a vpMeanDriftType into a string.

Parameters
[in]typeThe type of mean drift.
Returns
std::string The corresponding message.
Examples
testSPC.cpp, and tutorial-meandrift.cpp.

Definition at line 42 of file vpStatisticalTestAbstract.cpp.

References vpException::fatalError, MEAN_DRIFT_BOTH, MEAN_DRIFT_DOWNWARD, MEAN_DRIFT_NONE, MEAN_DRIFT_UNKNOWN, and MEAN_DRIFT_UPWARD.

Referenced by getAvailableMeanDriftType(), print(), and vpMeanDriftTypeFromString().

Member Data Documentation

◆ m_alpha

float vpStatisticalTestHinkley::m_alpha
protected

The $\alpha$ threshold indicating that a mean drift occurs.

Definition at line 98 of file vpStatisticalTestHinkley.h.

Referenced by detectDownwardMeanDrift(), detectUpwardMeanDrift(), getAlpha(), init(), setAlpha(), vpStatisticalTestHinkley(), and vpStatisticalTestHinkley().

◆ m_areStatisticsComputed

◆ m_computeDeltaAndAlpha

bool vpStatisticalTestHinkley::m_computeDeltaAndAlpha
protected

If true, compute $\delta$ and $\alpha$ from the standard deviation, the alarm factor and the detection factor.

Definition at line 103 of file vpStatisticalTestHinkley.h.

Referenced by init(), init(), init(), init(), init(), updateStatistics(), vpStatisticalTestHinkley(), and vpStatisticalTestHinkley().

◆ m_count

float vpStatisticalTestAbstract::m_count
protectedinherited

Current number of data used to compute the mean and the standard deviation.

Definition at line 115 of file vpStatisticalTestAbstract.h.

Referenced by vpStatisticalTestHinkley::computeMean(), init(), operator=(), updateStatistics(), vpStatisticalTestHinkley::updateTestSignals(), and vpStatisticalTestAbstract().

◆ m_dmin2

float vpStatisticalTestHinkley::m_dmin2
protected

Half of $\delta$, the drift minimal magnitude that we want to detect.

Definition at line 97 of file vpStatisticalTestHinkley.h.

Referenced by computeSk(), computeTk(), setDelta(), vpStatisticalTestHinkley(), and vpStatisticalTestHinkley().

◆ m_h

float vpStatisticalTestHinkley::m_h
protected

The alarm factor, that permits to compute $\alpha$ from the standard deviation of the signal.

Definition at line 105 of file vpStatisticalTestHinkley.h.

Referenced by computeAlphaDelta(), init(), init(), vpStatisticalTestHinkley(), and vpStatisticalTestHinkley().

◆ m_k

float vpStatisticalTestHinkley::m_k
protected

The detection factor, that permits to compute $\delta$ from the standard deviation of the signal.

Definition at line 106 of file vpStatisticalTestHinkley.h.

Referenced by computeAlphaDelta(), init(), init(), vpStatisticalTestHinkley(), and vpStatisticalTestHinkley().

◆ m_limitDown

◆ m_limitUp

◆ m_mean

◆ m_Mk

float vpStatisticalTestHinkley::m_Mk
protected

Maximum of the test signal for downward mean drift $S_k$ .

Definition at line 100 of file vpStatisticalTestHinkley.h.

Referenced by computeMean(), computeMk(), detectDownwardMeanDrift(), getMk(), init(), updateStatistics(), vpStatisticalTestHinkley(), and vpStatisticalTestHinkley().

◆ m_nbSamplesForStatistics

unsigned int vpStatisticalTestAbstract::m_nbSamplesForStatistics
protectedinherited

Number of samples to use to compute the mean and the standard deviation.

Definition at line 119 of file vpStatisticalTestAbstract.h.

Referenced by init(), operator=(), setNbSamplesForStat(), updateStatistics(), and vpStatisticalTestAbstract().

◆ m_Nk

float vpStatisticalTestHinkley::m_Nk
protected

Minimum of the test signal for upward mean drift $T_k$

Definition at line 102 of file vpStatisticalTestHinkley.h.

Referenced by computeMean(), computeNk(), detectUpwardMeanDrift(), getNk(), init(), updateStatistics(), vpStatisticalTestHinkley(), and vpStatisticalTestHinkley().

◆ m_s

float* vpStatisticalTestAbstract::m_s
protectedinherited

Array that keeps the samples used to compute the mean and standard deviation.

Definition at line 120 of file vpStatisticalTestAbstract.h.

Referenced by init(), operator=(), setNbSamplesForStat(), updateStatistics(), vpStatisticalTestAbstract(), and ~vpStatisticalTestAbstract().

◆ m_Sk

float vpStatisticalTestHinkley::m_Sk
protected

◆ m_stdev

◆ m_stdevmin

float vpStatisticalTestAbstract::m_stdevmin
protectedinherited

Minimum allowed standard deviation of the monitored signal.

Definition at line 122 of file vpStatisticalTestAbstract.h.

Referenced by setMinStdev(), updateStatistics(), and vpStatisticalTestAbstract().

◆ m_sumForMean

float vpStatisticalTestAbstract::m_sumForMean
protectedinherited

Sum of the samples used to compute the mean and standard deviation.

Definition at line 123 of file vpStatisticalTestAbstract.h.

Referenced by init(), vpStatisticalTestMeanAdjustedCUSUM::init(), operator=(), updateStatistics(), and vpStatisticalTestAbstract().

◆ m_Tk

float vpStatisticalTestHinkley::m_Tk
protected