Visual Servoing Platform
version 3.2.0 under development (2019-01-22)
|
#include <visp3/core/vpHinkley.h>
Public Types | |
enum | vpHinkleyJumpType { noJump, downwardJump, upwardJump } |
Public Member Functions | |
vpHinkley () | |
virtual | ~vpHinkley () |
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, downard 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.
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 76 of file vpHinkley.cpp.
|
virtual |
Destructor.
Definition at line 125 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 94 of file vpHinkley.cpp.
|
inline |
Definition at line 128 of file vpHinkley.h.
|
inline |
Definition at line 139 of file vpHinkley.h.
|
inline |
Definition at line 151 of file vpHinkley.h.
|
inline |
Definition at line 134 of file vpHinkley.h.
|
inline |
Definition at line 146 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 133 of file vpHinkley.cpp.
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 112 of file vpHinkley.cpp.
References init(), setAlpha(), and setDelta().
Referenced by init().
|
static |
Definition at line 422 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 162 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 153 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 293 of file vpHinkley.cpp.
References downwardJump, vpMath::maximum(), 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 174 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 234 of file vpHinkley.cpp.
References downwardJump, noJump, upwardJump, and vpCDEBUG.