ViSP
2.9.0
|
#include <vpHinkley.h>
Public Types | |
enum | vpHinkleyJumpType { noJump, downwardJump, upwardJump } |
Public Member Functions | |
vpHinkley () | |
~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 100 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 106 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 80 of file vpHinkley.cpp.
vpHinkley::~vpHinkley | ( | ) |
Destructor.
Definition at line 133 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 101 of file vpHinkley.cpp.
|
inline |
Definition at line 132 of file vpHinkley.h.
|
inline |
Definition at line 142 of file vpHinkley.h.
|
inline |
Definition at line 154 of file vpHinkley.h.
|
inline |
Definition at line 137 of file vpHinkley.h.
|
inline |
Definition at line 149 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 143 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 120 of file vpHinkley.cpp.
References init(), setAlpha(), and setDelta().
|
static |
Definition at line 431 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 175 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 163 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 305 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 190 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 248 of file vpHinkley.cpp.
References downwardJump, noJump, upwardJump, and vpCDEBUG.