|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nist.microanalysis.Utility.LinearRegression
public class LinearRegression
Implements a class for computing the linear regression (the best fit line in a least-squares sense.)
| Constructor Summary | |
|---|---|
LinearRegression()
Constructs an object implementing the linear regression for best fitting a line to data points (in a least-squares sense.) |
|
| Method Summary | |
|---|---|
void |
addData(double[] x,
double[] y)
addData - Add two equal lengthed arrays of data points to the current accumulation. |
void |
addDatum(double x,
double y)
addDatum - Add a single data point |
void |
clear()
clear - Clear the current accumulation and start a new fit. |
double |
computeX(double y)
computeX - Computes the x such that y(x) = x*getSlope() + getIntercept(); |
double |
computeY(double x)
computeY - Computes Y(x) = x*getSlope() + getIntercept(); |
double |
getIntercept()
getIntercept - Returns the current best estimate of the y-intercept. |
double |
getR()
getR - A measure of the goodness of fit to a linear model |
double |
getRSquared()
getR - The standard measure of the goodness of fit to a linear model. |
double |
getSlope()
getSlope - Returns the current best estimate of the slope. |
void |
removeDatum(double x,
double y)
removeDatum - Removes a single data point from the set of data to be fit. |
void |
setData(double[] x,
double[] y)
setData - Clear the current accumulation and add two equal lengthed arrays of data points. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LinearRegression()
| Method Detail |
|---|
public void clear()
public void setData(double[] x,
double[] y)
x - y -
public void addData(double[] x,
double[] y)
x - y -
public void addDatum(double x,
double y)
x - y -
public void removeDatum(double x,
double y)
x - y - public double getSlope()
public double getIntercept()
public double computeY(double x)
x -
public double computeX(double y)
y -
public double getR()
public double getRSquared()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||