public class LinearRegression
extends java.lang.Object
| 构造器和说明 |
|---|
LinearRegression(float[] x,
float[] y)
Performs a linear regression on the data points (y[i], x[i]).
|
| 限定符和类型 | 方法和说明 |
|---|---|
double |
intercept()
Returns the y-intercept α of the best of the best-fit line y = α + β x.
|
double |
interceptStdErr()
Returns the standard error of the estimate for the intercept.
|
double |
predict(double x)
Returns the expected response y given the value of the predictor
variable x.
|
double |
R2()
Returns the coefficient of determination R2.
|
double |
slope()
Returns the slope β of the best of the best-fit line y = α + β x.
|
double |
slopeStdErr()
Returns the standard error of the estimate for the slope.
|
java.lang.String |
toString()
Returns a string representation of the simple linear regression model.
|
public LinearRegression(float[] x,
float[] y)
x - the values of the predictor variabley - the corresponding values of the response variablepublic double intercept()
public double slope()
public double R2()
public double interceptStdErr()
public double slopeStdErr()
public double predict(double x)
x - the value of the predictor variablepublic java.lang.String toString()
toString 在类中 java.lang.Object