Skip to content

Documentation / @ripl/charts / LinearRegression

Interface: LinearRegression ​

Defined in: charts/src/core/statistics.ts:55

A fitted simple linear regression.

Properties ​

PropertyTypeDescriptionDefined in
interceptnumberY-intercept of the fitted line.charts/src/core/statistics.ts:59
r2numberCoefficient of determination (R²), measuring goodness of fit.charts/src/core/statistics.ts:61
slopenumberSlope of the fitted line.charts/src/core/statistics.ts:57

Methods ​

predict() ​

predict(x): number

Defined in: charts/src/core/statistics.ts:63

Predicts y for a given x from the fitted line.

Parameters ​

ParameterType
xnumber

Returns ​

number