StatisticalTestSigma¶
- class StatisticalTestSigma(*args, **kwargs)¶
Bases:
StatisticalTestAbstract
Class that permits a simple test comparing the current value to the standard deviation of the signal.
Be \(s(t)\) the signal to monitor, \(\mu\) and \(\sigma\) the mean and standard deviation of this signal when it is “in control”.
Be \(h\) a user-defined alarm factor.
A downward alarm is raised if: \(s(t) >= \mu - h \sigma\)
An upward alarm is raised if: \(s(t) >= \mu - h \sigma\)
\(h\) is often set to 3 if we assume the \(s(t)\) follows a normal distribution.
To detect only downward drifts of the input signal \(s(t)\) use testDownwardMeanDrift() .To detect only upward drifts in \(s(t)\) use testUpwardMeanDrift() . To detect both, downward and upward drifts use testDownUpwardMeanDrift() .
Overloaded function.
__init__(self: visp._visp.core.StatisticalTestSigma, h: float = 3.f, nbSamplesForStats: int = 30) -> None
Construct a new vpStatisticalTestSigma object.
- Parameters:
- h
The alarm factor applied to the standard deviation to compute the limits.
- nbSamplesForStats
The number of samples to compute the statistics of the signal.
__init__(self: visp._visp.core.StatisticalTestSigma, h: float, mean: float, stdev: float) -> None
Construct a new vpStatisticalTestSigma object.
- Parameters:
- h
The alarm factor applied to the standard deviation to compute the limits.
- mean
The expected mean of the signal.
- stdev
The expected standard deviation of the signal.
Methods
Overloaded function.
Get the last value of the signal.
Overloaded function.
Inherited Methods
Get the list of available vpMeanDriftType objects that are handled.
Set the minimum value of the standard deviation that is expected.
Test if an upward mean drift occurred according to the new value of the signal.
MEAN_DRIFT_DOWNWARD
MEAN_DRIFT_NONE
Set the number of samples required to compute the mean and standard deviation of the signal and allocate the memory accordingly.
Get the standard deviation used as reference.
Test if a downward or an upward mean drift occurred according to the new value of the signal.
Enum that indicates if a drift of the mean occurred.
MEAN_DRIFT_BOTH
MEAN_DRIFT_UNKNOWN
Cast a string into a vpMeanDriftType .
Get the upper and lower limits of the test signal.
MEAN_DRIFT_UPWARD
MEAN_DRIFT_COUNT
Test if a downward mean drift occurred according to the new value of the signal.
Get the mean used as reference.
Operators
__annotations__
__doc__
Overloaded function.
__module__
Attributes
MEAN_DRIFT_BOTH
MEAN_DRIFT_COUNT
MEAN_DRIFT_DOWNWARD
MEAN_DRIFT_NONE
MEAN_DRIFT_UNKNOWN
MEAN_DRIFT_UPWARD
__annotations__
- class MeanDriftType(self, value: int)¶
Bases:
pybind11_object
Enum that indicates if a drift of the mean occurred.
Values:
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
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.core.StatisticalTestSigma, h: float = 3.f, nbSamplesForStats: int = 30) -> None
Construct a new vpStatisticalTestSigma object.
- Parameters:
- h
The alarm factor applied to the standard deviation to compute the limits.
- nbSamplesForStats
The number of samples to compute the statistics of the signal.
__init__(self: visp._visp.core.StatisticalTestSigma, h: float, mean: float, stdev: float) -> None
Construct a new vpStatisticalTestSigma object.
- Parameters:
- h
The alarm factor applied to the standard deviation to compute the limits.
- mean
The expected mean of the signal.
- stdev
The expected standard deviation of the signal.
- static getAvailableMeanDriftType(prefix: str = <, sep: str =, suffix: str = >) str ¶
Get the list of available vpMeanDriftType objects that are handled.
- Parameters:
- prefix
The prefix that should be placed before the list.
- sep
The separator between each element of the list.
- suffix
The suffix that should terminate the list.
- Returns:
std::string The list of handled type of process tests, presented as a string.
- getLimits(self, limitDown: float, limitUp: float) tuple[float, float] ¶
Get the upper and lower limits of the test signal.
- getStdev(self) float ¶
Get the standard deviation used as reference.
- Returns:
float The standard deviation.
- init(*args, **kwargs)¶
Overloaded function.
init(self: visp._visp.core.StatisticalTestSigma, h: float = 3.f, nbSamplesForStats: int = 30) -> None
(Re)Initialize the test.
- Parameters:
- h
The alarm factor applied to the standard deviation to compute the limits.
- nbSamplesForStats
The number of samples to compute the statistics of the signal.
init(self: visp._visp.core.StatisticalTestSigma, h: float, mean: float, stdev: float) -> None
(Re)Initialize the test.
- Parameters:
- h
The alarm factor applied to the standard deviation to compute the limits.
- mean
The expected mean of the signal.
- stdev
The expected standard deviation of the signal.
init(self: visp._visp.core.StatisticalTestAbstract) -> None
(Re)Initialize the algorithm.
- static print(type: visp._visp.core.StatisticalTestAbstract.MeanDriftType) None ¶
- setMinStdev(self, stdevmin: float) None ¶
Set the minimum value of the standard deviation that is expected. The computed standard deviation cannot be lower this value if set.
- setNbSamplesForStat(self, nbSamples: int) None ¶
Set the number of samples required to compute the mean and standard deviation of the signal and allocate the memory accordingly.
- testDownUpwardMeanDrift(self, signal: float) visp._visp.core.StatisticalTestAbstract.MeanDriftType ¶
Test if a downward or an upward mean drift occurred according to the new value of the signal.
Note
See testDownwardMeanDrift() testUpwardMeanDrift()
- testDownwardMeanDrift(self, signal: float) visp._visp.core.StatisticalTestAbstract.MeanDriftType ¶
Test if a downward mean drift occurred according to the new value of the signal.
Note
See testUpwardMeanDrift()
- testUpwardMeanDrift(self, signal: float) visp._visp.core.StatisticalTestAbstract.MeanDriftType ¶
Test if an upward mean drift occurred according to the new value of the signal.
Note
See testDownwardMeanDrift()
- static vpMeanDriftTypeFromString(name: str) visp._visp.core.StatisticalTestAbstract.MeanDriftType ¶
Cast a string into a vpMeanDriftType .
- static vpMeanDriftTypeToString(type: visp._visp.core.StatisticalTestAbstract.MeanDriftType) str ¶