Versions:

Statistical aggregates

This section includes functions related to statistical aggregates.

Some hyperfunctions are included in the default TimescaleDB product. For additional hyperfunctions, you need to install the Timescale Toolkit PostgreSQL extension, all of these aggregates are in the Timescale Toolkit. They provide a superset of functionality available with PostgreSQL statistical aggregates.

Statistical aggregates have one-dimensional (1D) aggregates which are computed for a single variable, and two-dimensional (2D) or regression aggregates which are computed over two variables. All 1D aggregates are available for each of the 2D variables separately, this is denoted by _y or _x following the name.

For more information about statistical aggregate functions, see the hyperfunctions documentation.

Hyperfunction familyTypesAPI CallsIncluded by defaultToolkit required
Statistical AggregatesStatistical Aggregatesstats_agg
rollup
rolling
Statistical aggregationStats Agg 1D Accessorsaverage / average_y / average_x
kurtosis / kurtosis_y / kurtosis_x
num_vals
skewness / skewness_y / skewness_x
stddev / stddev_y / stddev_x
sum / sum_y / sum_x
variance / variance_y / variance_x
Statistical aggregationStats Agg 2D Accessorscorr
covariance
determination_coeff
intercept
slope
x_intercept

Found an issue on this page?

Report an issue!

Related Content