|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--jsc.curvefitting.LineFitThruOrigin
Least squares fitted straight line through the origin. This class calculates and stores the least squares straight line constrained to pass through the origin, y = Bx, fitted to an array of data pairs (x,y).
| Constructor Summary | |
LineFitThruOrigin(PairedData data)
Creates the least squares estimate from paired data (x,y). |
|
| Method Summary | |
double |
getA()
Returns estimate of intercept term, A. |
double |
getB()
Returns least squares estimate of B. |
ConfidenceInterval |
getCIB(double coeff)
Returns confidence interval of estimate of slope, B. |
double[][] |
getIntervals(double coeff,
int k,
double xMin,
double xMax)
Calculates confidence intervals for the mean, Bx, and prediction intervals for the response, Y. |
double |
getMeanX()
Returns mean of x. |
double |
getMeanY()
Returns mean of y. |
int |
getN()
Returns number of observations in sample. |
double |
getSumOfSquares()
Return the sum of squared deviations. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LineFitThruOrigin(PairedData data)
data - the data pairs (x,y).
IllegalArgumentException - if x data are constant.| Method Detail |
public double getA()
StraightLineFit
getA in interface StraightLineFitpublic double getB()
getB in interface StraightLineFitpublic ConfidenceInterval getCIB(double coeff)
coeff - the confidence coefficient, which must be between 0 and 1.
IllegalArgumentException - if coeff < 0 or > 1.
IllegalArgumentException - if < 2 observations.
public double[][] getIntervals(double coeff,
int k,
double xMin,
double xMax)
Column 0 contains the k x-values.
Column 1 contains the corresponding lower limits of the CIs for the mean,
Column 2 contains the corresponding upper limits of the CIs for the mean.
Column 3 contains the corresponding lower limits of the prediction intervals.
Column 4 contains the corresponding upper limits of the prediction intervals.
This method is useful for obtaining the co-ordinates for drawing the CI and prediction interval curves on a scatterplot.
coeff - the confidence coefficient, which must be between 0 and 1.k - the number of x-values at which the CIs are calculated.xMin - the first x-values at which the CIs are calculated.xMax - the last x-values at which the CIs are calculated.
IllegalArgumentException - if coeff < 0 or > 1.
IllegalArgumentException - if xMin is not < xMax.
IllegalArgumentException - if < 2 observations.public double getMeanX()
public double getMeanY()
public int getN()
public double getSumOfSquares()
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||