public class Regressions
extends java.lang.Object
see http://math.nist.gov/javanumerics/jama/
Constructor and Description |
---|
Regressions() |
Modifier and Type | Method and Description |
---|---|
static double |
getMean(double[] y)
Get the mean of a set of values
|
static double[] |
linFit(double[] x,
double[] y)
Fit a linear regression line to a set of points
|
static double[] |
meanFit(double[] y)
Return the mean of a set of points as a one element array for compatibility with
other, higher order fits.
|
static double[] |
polyFit(double[] x,
double[] y,
int order) |
static double[] |
squareFit(double[] x,
double[] y)
Fit a second order polynomial to a set of points
|
static double |
value(double[] fitParams,
double x)
Use the parameters of the fit to calculate a value
using the fitParams polynomial.
|
public static double[] polyFit(double[] x, double[] y, int order)
public static double[] meanFit(double[] y)
y
- array ofvaluespublic static double getMean(double[] y)
y
- array ofvaluespublic static double[] linFit(double[] x, double[] y)
x
- array of x coordinatesy
- array of y coordinatespublic static double[] squareFit(double[] x, double[] y)
x
- array of x coordinatesy
- array of y coordinatespublic static double value(double[] fitParams, double x)
fitParams
- parameters of the fitx
- x value