IOOS_QC QARTOD Spike_Test is a direct implementation of the spike test described within the QARTOD Manual. This algorithm is acting in some conditions similarly than the the rate_of_change test. We present here a potential implementation of an alternative method which will target exclusively the single spike values over a certain threshold.
I suggest implementing this second method as an option within the QARTOD spike_test via a method optional input and keeping the original average method as the default one.
The method consider essentially that a value N is flagged if the following conditions are respected:
The absolute value of the difference between the value N and its preceding (N-1) and following value (N+1) is bigger than a threshold
The multiplication of both difference is smaller than 0 (opposite direction).
""
To highlight the difference between the two methods, an example can be find here within a jupyter notebook which is using the following vector and threshold values:
By applying the regular QARTOD Spike method, we get the following result:
Differential Method (suggested alternative method)
Here's the results in similar conditions for the suggested differential method.
As shown, the second method only flag the single spike values without flagging records that are associated with a strong preceding jump. The QARTOD rate of change test can then be use to flag those data more rigorously if desired.
IOOS_QC QARTOD Spike_Test is a direct implementation of the spike test described within the QARTOD Manual. This algorithm is acting in some conditions similarly than the the rate_of_change test. We present here a potential implementation of an alternative method which will target exclusively the single spike values over a certain threshold.
I suggest implementing this second method as an option within the QARTOD spike_test via a method optional input and keeping the original average method as the default one.
The method consider essentially that a value N is flagged if the following conditions are respected:
"
"
To highlight the difference between the two methods, an example can be find here within a jupyter notebook which is using the following vector and threshold values:
Average Method (suggested by QARTOD)
By applying the regular QARTOD Spike method, we get the following result:![image](https://user-images.githubusercontent.com/30420025/107834850-53743980-6d4c-11eb-96ea-22c52b2c5605.png)
Differential Method (suggested alternative method)
Here's the results in similar conditions for the suggested differential method.![image](https://user-images.githubusercontent.com/30420025/107835241-a0a4db00-6d4d-11eb-8985-7668568d6d42.png)
As shown, the second method only flag the single spike values without flagging records that are associated with a strong preceding jump. The QARTOD rate of change test can then be use to flag those data more rigorously if desired.