Moving stdev
Data quality rule that verifies if a data quality check reading is comparable to stdev range. A stdev is calculated based on previous results. The time window in which we define a number of previous results used to calculate stdev is customizable.
Parameters
This rule has two parameters that should be declared for each alert.
low
:
rule threshold for a low severity (1) alertmultiple_stdev_above
: floatmultiple_stdev_below
: float
medium
:
rule threshold for a medium severity (2) alertmultiple_stdev_above
: floatmultiple_stdev_below
: float
high
:
rule threshold for a high severity (3) alertmultiple_stdev_above
: floatmultiple_stdev_below
: float
Example
The following example shows how to implement moving_stdev
rule in regex_match_percent
sensor for a check.
The assigned severity depends on sensor result (see YAML configuration below):
Let's suppose that average X
and stdev Y
are calculated based on last n
readings. If result is in defined ranges, then the following alerts are returned
X + low.multipe_stdev_above * Y > result > X - low.multiple_stdev_below * Y
, the check is passed: valid resultX + medium.multiple_stdev_below * Y < result < X - low.multiple_stdev_below * Y
andX + medium.multipe_stdev_above * Y > result > X - low.multipe_stdev_above * Y
the severity is low (1)X + high.multiple_stdev_below * Y < result < X - medium.multiple_stdev_below * Y
andX + high.multiple_stdev_above * Y > result > X - medium.multiple_stdev_above * Y
the severity is low (2)X + high.multiple_stdev_below * Y > result
orX + high.multiple_stdev_above * Y < result
the severity is high (3)
As you can see, time series specification is defined. It's necessary to indicate which column in your table is timestamp. You can do it defining fields timestamp_column
, time_gradient
, and mode
in time_series
section.