- Index

< Previous |  | Next >

## intercept

intercept — aggregate function to return the value where a best-fit linear regression line intersects the Y axis.

## SYNOPSIS

`intercept (double `field-x`, double `field-y`)`

## DESCRIPTION

For the data set of fields x and y for all rows in the aggregate's window, a best-fit linear regression line is calculated, then the function returns the value at which the line intersects the Y axis. The method used to find the line that best fits a group of points is called least squares or linear least squares.

If the query returns no rows to the aggregate's window, the function returns `null`. If the query returns a row count of 1 or −1, the result is also null.

## SEE ALSO

This LiveView aggregate function is based on the intercept aggregate function in the StreamBase expression language.