Class PolynomialRegression
java.lang.Object
org.episteme.core.mathematics.statistics.fitting.PolynomialRegression
Polynomial regression: y = aâ‚€ + aâ‚Âx + aâ‚‚x² + ... + aâ‚™xâ¿.
Uses normal equations with LU decomposition for stability.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionstatic PolynomialRegressionfit(double[] x, double[] y, int degree) Fits a polynomial of given degree to the data.double[]intdoubledoublepredict(double x) Predicts y for given x.toString()
-
Method Details
-
fit
Fits a polynomial of given degree to the data.- Parameters:
x- Independent variable valuesy- Dependent variable valuesdegree- Polynomial degree (1 = linear, 2 = quadratic, etc.)- Returns:
- PolynomialRegression model
-
predict
public double predict(double x) Predicts y for given x. -
predict
-
getCoefficients
public double[] getCoefficients() -
getDegree
public int getDegree() -
getRSquared
public double getRSquared() -
toString
-