Catalano.Statistics.Regression
Class PolynomialRegression
- java.lang.Object
-
- Catalano.Statistics.Regression.PolynomialRegression
-
- All Implemented Interfaces:
- ISimpleRegression
public class PolynomialRegression extends java.lang.Object implements ISimpleRegression
Polynomial Regression.
-
-
Constructor Summary
Constructors Constructor and Description PolynomialRegression(double[] x, double[] y)Initializes a new instance of the PolynomialRegression class.PolynomialRegression(double[] x, double[] y, int degree)Initializes a new instance of the PolynomialRegression class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleCoefficientOfDetermination()Get the R^2.intgetDegree()Get degree.doubleRegression(double x)Compute regression of specific value.double[]Regression(double[] x)Compute regression in the vector.voidsetDegree(int degree)Set degree.java.lang.StringtoString()Show the regression's equation.
-
-
-
Constructor Detail
-
PolynomialRegression
public PolynomialRegression(double[] x, double[] y)Initializes a new instance of the PolynomialRegression class.- Parameters:
x- Data.y- Data.
-
PolynomialRegression
public PolynomialRegression(double[] x, double[] y, int degree)Initializes a new instance of the PolynomialRegression class.- Parameters:
x- Data.y- Data.degree- Degree.
-
-
Method Detail
-
getDegree
public int getDegree()
Get degree.- Returns:
- Degree.
-
setDegree
public void setDegree(int degree)
Set degree.- Parameters:
degree- Degree.
-
Regression
public double Regression(double x)
Description copied from interface:ISimpleRegressionCompute regression of specific value.- Specified by:
Regressionin interfaceISimpleRegression- Parameters:
x- Value.- Returns:
- Regression.
-
Regression
public double[] Regression(double[] x)
Description copied from interface:ISimpleRegressionCompute regression in the vector.- Specified by:
Regressionin interfaceISimpleRegression- Parameters:
x- Vector.- Returns:
- Regression.
-
CoefficientOfDetermination
public double CoefficientOfDetermination()
Description copied from interface:ISimpleRegressionGet the R^2.- Specified by:
CoefficientOfDeterminationin interfaceISimpleRegression- Returns:
-
toString
public java.lang.String toString()
Description copied from interface:ISimpleRegressionShow the regression's equation.- Specified by:
toStringin interfaceISimpleRegression- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG