COVAR_POP() OVER ...

All functions > WINDOW FUNCTION > COVAR_POP() OVER ...

Returns the population covariance over the window frame.

Syntax

COVAR_POP(expr_y, expr_x) OVER ([PARTITION BY expr [, ...]] [ORDER BY sort_item [, ...]] [ROWS|RANGE|GROUPS frame])

Notes

  • Computes population covariance (divides by N) over a window
  • NULL values in either expression are excluded

See also

Examples

FeatureQL
SELECT
    f1 := ZIP(ARRAY[1,2,3] AS id, ARRAY[1.0E0,2.0E0,3.0E0] AS y, ARRAY[1.0E0,2.0E0,4.0E0] AS x).TRANSFORM(SELECT COVAR_POP(y, x) OVER (ORDER BY id ASC)).UNWRAP() -- Population covariance over the frame
;
Result
f1 ARRAY
[0.00, 0.25, 1.00]

Last update at: 2026/05/26 17:22:09