Visual Servoing Platform
version 3.6.1 under development (2024-10-01)
|
#include <visp3/core/vpHinkley.h>
Public Types | |
enum | vpHinkleyJumpType { noJump , downwardJump , upwardJump } |
Public Member Functions | |
VP_DEPRECATED | vpHinkley () |
virtual | ~vpHinkley () |
VP_DEPRECATED | vpHinkley (double alpha, double delta) |
void | init () |
void | init (double alpha, double delta) |
void | setDelta (double delta) |
void | setAlpha (double alpha) |
vpHinkleyJumpType | testDownwardJump (double signal) |
vpHinkleyJumpType | testUpwardJump (double signal) |
vpHinkleyJumpType | testDownUpwardJump (double signal) |
double | getMean () |
double | getSk () |
double | getMk () |
double | getTk () |
double | getNk () |
Static Public Member Functions | |
static void | print (vpHinkleyJumpType jump) |
This class implements the Hinkley's cumulative sum test.
The Hinkley's cumulative sum test is designed to detect jump in mean of an observed signal . 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 jump 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 jumps in , respectively defined by:
In which is computed on-line and corresponds to the mean of the signal we want to detect a jump. is re-initialized at zero after each jump detection. denotes the jump minimal magnitude that we want to detect and is a predefined threshold. These values are set by default to 0.2 in the default constructor vpHinkley(). To modify the default values use setAlpha() and setDelta() or the vpHinkley(double alpha, double delta) constructor.
A downward jump is detected if . A upward jump is detected if .
To detect only downward jumps in use testDownwardJump().To detect only upward jumps in use testUpwardJump(). To detect both, downward and upward jumps use testDownUpwardJump().
If a jump is detected, the jump location is given by the last instant when , or .
Definition at line 96 of file vpHinkley.h.
Indicates if a jump is detected by the Hinkley test.
Enumerator | |
---|---|
noJump | No jump is detected by the Hinkley test. |
downwardJump | A downward jump is detected by the Hinkley test. |
upwardJump | An upward jump is detected by the Hinkley test. |
Definition at line 102 of file vpHinkley.h.
BEGIN_VISP_NAMESPACE vpHinkley::vpHinkley | ( | ) |
Constructor.
Call init() to initialise the Hinkley's test and set and to default values.
By default and . Use setDelta() and setAlpha() to modify these values.
Definition at line 74 of file vpHinkley.cpp.
|
virtual |
Destructor.
Definition at line 122 of file vpHinkley.cpp.
vpHinkley::vpHinkley | ( | double | alpha_val, |
double | delta_val | ||
) |
Constructor.
Call init() to initialise the Hinkley's test and set and thresholds.
alpha_val | : is a predefined threshold. |
delta_val | : denotes the jump minimal magnitude that we want to detect. |
Definition at line 92 of file vpHinkley.cpp.
|
inline |
Definition at line 129 of file vpHinkley.h.
|
inline |
Definition at line 140 of file vpHinkley.h.
|
inline |
Definition at line 152 of file vpHinkley.h.
|
inline |
Definition at line 135 of file vpHinkley.h.
|
inline |
Definition at line 147 of file vpHinkley.h.
void vpHinkley::init | ( | ) |
Initialise the Hinkley's test by setting the mean signal value to zero as well as .
Definition at line 130 of file vpHinkley.cpp.
Referenced by init().
void vpHinkley::init | ( | double | alpha_val, |
double | delta_val | ||
) |
Call init() to initialise the Hinkley's test and set and thresholds.
alpha_val | : is a predefined threshold. |
delta_val | : denotes the jump minimal magnitude that we want to detect. |
Definition at line 109 of file vpHinkley.cpp.
References init(), setAlpha(), and setDelta().
|
static |
Definition at line 419 of file vpHinkley.cpp.
References downwardJump, noJump, and upwardJump.
void vpHinkley::setAlpha | ( | double | alpha_val | ) |
Set the value of , a predefined threshold.
Definition at line 159 of file vpHinkley.cpp.
Referenced by init().
void vpHinkley::setDelta | ( | double | delta | ) |
Set the value of , the jump minimal magnetude that we want to detect.
Definition at line 150 of file vpHinkley.cpp.
Referenced by init().
vpHinkley::vpHinkleyJumpType vpHinkley::testDownUpwardJump | ( | double | signal | ) |
Perform the Hinkley test. A downward jump is detected if . An upward jump is detected if .
signal | : Observed signal . |
Definition at line 290 of file vpHinkley.cpp.
References downwardJump, noJump, upwardJump, and vpCDEBUG.
vpHinkley::vpHinkleyJumpType vpHinkley::testDownwardJump | ( | double | signal | ) |
Perform the Hinkley test. A downward jump is detected if .
signal | : Observed signal . |
Definition at line 171 of file vpHinkley.cpp.
References downwardJump, noJump, upwardJump, and vpCDEBUG.
vpHinkley::vpHinkleyJumpType vpHinkley::testUpwardJump | ( | double | signal | ) |
Perform the Hinkley test. An upward jump is detected if .
signal | : Observed signal . |
Definition at line 231 of file vpHinkley.cpp.
References downwardJump, noJump, upwardJump, and vpCDEBUG.