mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
* prefer relative links from root * wip * split aggregate function reference * split system tables
1.3 KiB
1.3 KiB
toc_priority
| toc_priority |
|---|
| 220 |
simpleLinearRegression
Performs simple (unidimensional) linear regression.
simpleLinearRegression(x, y)
Parameters:
x— Column with dependent variable values.y— Column with explanatory variable values.
Returned values:
Constants (a, b) of the resulting line y = a*x + b.
Examples
SELECT arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [0, 1, 2, 3])
┌─arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [0, 1, 2, 3])─┐
│ (1,0) │
└───────────────────────────────────────────────────────────────────┘
SELECT arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6])
┌─arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6])─┐
│ (1,3) │
└───────────────────────────────────────────────────────────────────┘