Skip to main content
Skip to main content

varPopStable

varPopStable

Introduced in: v1.1

Returns the population variance. Unlike varPop, this function uses a numerically stable algorithm. It works slower but provides a lower computational error.

Syntax

varPopStable(x)

Arguments

Returned value

Returns the population variance of x. Float64

Examples

Computing stable population variance

DROP TABLE IF EXISTS test_data;
CREATE TABLE test_data
(
    x UInt8,
)
ENGINE = Memory;

INSERT INTO test_data VALUES (3),(3),(3),(4),(4),(5),(5),(7),(11),(15);

SELECT
    varPopStable(x) AS var_pop_stable
FROM test_data;
┌─var_pop_stable─┐
│           14.4 │
└────────────────┘