Samples
Calculate the y intercept from independent variabley and dependent variable x for each 15-minute time bucket:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Calculate the intercept from a two-dimensional statistical aggregate
y and dependent variable x for each 15-minute time bucket:
SELECT
id,
time_bucket('15 min'::interval, ts) AS bucket,
intercept(stats_agg(y, x)) AS summary
FROM foo
GROUP BY id, time_bucket('15 min'::interval, ts)
intercept(
summary StatsSummary2D
) RETURNS DOUBLE PRECISION
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| summary | StatsSummary2D | - | ✔ | The statistical aggregate produced by a stats_agg call |
| Column | Type | Description |
|---|---|---|
| intercept | DOUBLE PRECISION | The y intercept of the least-squares fit line |