Class LinearRegression
java.lang.Object
org.episteme.core.mathematics.statistics.fitting.LinearRegression
Linear regression: y = a + b*x (least squares).
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionstatic LinearRegressionfit(double[] x, double[] y) Fits a linear model to the data.static LinearRegressionFits linear model using Real types.doubledoubleintdoublegetSlope()doubledoublepredict(double x) Predicts y for given x.toString()
-
Method Details
-
fit
Fits a linear model to the data.- Parameters:
x- Independent variable valuesy- Dependent variable values- Returns:
- LinearRegression model
-
fit
Fits linear model using Real types. -
predict
public double predict(double x) Predicts y for given x. -
predict
-
getSlope
public double getSlope() -
getIntercept
public double getIntercept() -
getRSquared
public double getRSquared() -
getStandardError
public double getStandardError() -
getSampleSize
public int getSampleSize() -
toString
-