This function uses the output of the findOutliers()
function in the seismicRoll
package to calculate the number of 'spikes' containing outliers.
The thresholdMin
level is similar to a sigma value for normally distributed data.
Hampel filter values above 6.0 indicate a data value that is extremely unlikely
to be part of a normal distribution (~ 1/500 million) and therefore very likely to be an outlier. By
choosing a relatively large value for thresholdMin
we make it less likely that we
will generate false positives. False positives can include high frequency environmental noise.
The selectivity
is a value between 0 and 1 and is used to generate an appropriate
threshold for outlier detection based on the statistics of the incoming data. A lower value
for selectivity
will result in more outliers while a value closer to 1.0 will result in
fewer. The code ignores selectivity if fixedThreshold=TRUE
.
The fixedThreshold
is a logical TRUE
or FALSE
. If TRUE
, then the threshold is set to thresholdMin
.
If FALSE
, then the threshold is set to maximum value of the roll_hample()
function output multiplied by the selectivity
.
The total count of spikes reflects the number of outlier data points that are separated by at least
one non-outlier data point. Each individual spike may contain more than one data point.