From 27552c4c3285ae678e7ef399139276ec4951ba0e Mon Sep 17 00:00:00 2001 From: Carlos Gomes <50534116+cgomesu@users.noreply.github.com> Date: Wed, 30 Jun 2021 03:42:37 -0300 Subject: [PATCH] Add quantiles reference and config variables (#18314) --- source/_integrations/statistics.markdown | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/_integrations/statistics.markdown b/source/_integrations/statistics.markdown index 84194cd5916..da09bb48712 100644 --- a/source/_integrations/statistics.markdown +++ b/source/_integrations/statistics.markdown @@ -14,7 +14,7 @@ ha_platforms: - sensor --- -The `statistics` sensor platform consumes the state from other sensors. It exports the `mean` value as state and the following values as attributes: `count`, `mean`, `median`, `stdev`, `variance`, `total`, `min_value`, `max_value`, `min_age`, `max_age`, `change`, `average_change` and `change_rate`. If the source is a binary sensor then only state changes are counted. +The `statistics` sensor platform consumes the state from other sensors. It exports the `mean` value as state and the following values as attributes: `count`, `mean`, `median`, `quantiles`, `stdev`, `variance`, `total`, `min_value`, `max_value`, `min_age`, `max_age`, `change`, `average_change` and `change_rate`. If the source is a binary sensor then only state changes are counted. Assuming the [`recorder`](/integrations/recorder/) integration is running (either configured explicitly or as part of a meta-integration/dependency, e.g., [`default_config`](/integrations/default_config/), [`history`](/integrations/history/), etc.), historical sensor data is read from the database on startup and is available immediately after a restart of the platform. If the [`recorder`](/integrations/recorder/) integration is *not* running, it can take time for the sensor to start reporting data because some attribute calculations require more than one value. @@ -58,6 +58,16 @@ precision: required: false default: 2 type: integer +quantile_intervals: + description: Number of continuous intervals with equal probability. Value must be an integer higher than `1`. In addition, `quantiles` will be `unknown` unless the number of quantile intervals is *lower* than the number of data points (`count`). Set it to `4` for quartiles (default) or to `100` for percentiles, for example. + required: false + default: 4 + type: integer +quantile_method: + description: Indicates whether quantiles are computed using the `exclusive` method (default) or `inclusive`. The `exclusive` method assumes the population data have more extreme values than the sample, and therefore, the part under the *i*-th of *m* sorted data points is computed as `i / (m + 1)`. The `inclusive` method assumes that the sample data includes the more extreme values from the population, and therefore, the part under the *i*-th of *m* sorted data points is computed as `(i - 1) / (m - 1)`. + required: false + default: exclusive + type: string {% endconfiguration %}