SimpleLinearRegressionResult
The result of a simple linear regression fit (y = intercept + slope * x).
Example:
val result = simpleLinearRegression(x, y)
result.slope // change in y per unit change in x
result.intercept // predicted y when x = 0
result.rSquared // proportion of variance explained (0.0 to 1.0)
result.predict(6.0) // predict y for a new x valueContent copied to clipboard
Properties
Link copied to clipboard
The difference between each observed y value and the predicted value (y - predicted). Residuals sum to approximately zero for a correctly fitted model.
Link copied to clipboard
the coefficient of determination, indicating the proportion of variance in y explained by the linear relationship with x. Ranges from 0.0 (no explanatory power) to 1.0 (perfect fit). Returns 1.0 when y has zero variance (all values identical), since there is no variance left to explain.
Link copied to clipboard
the standard error of the intercept estimate, measuring the uncertainty in intercept.
Link copied to clipboard
the standard error of the slope estimate, measuring the uncertainty in slope. Smaller values indicate a more precise estimate.