Skip to content

Documentation / @ripl/charts / LinearRegression

Interface: LinearRegression

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

A fitted simple linear regression.

Properties

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

Methods

predict()

predict(x): number

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

Predicts y for a given x from the fitted line.

Parameters

ParameterType
xnumber

Returns

number