dwvisser.statistics
Class PolynomialFitErrY
java.lang.Object
|
+--dwvisser.statistics.PolynomialFitErrY
- public class PolynomialFitErrY
- extends java.lang.Object
Given a data set, performs a linear regression, then can be queried for the results.
Based on code in Numerical Recipes in C
- Author:
- Dale Visser
Constructor Summary |
PolynomialFitErrY(java.io.File batch,
java.io.File out,
boolean centered)
|
PolynomialFitErrY(int order,
double[] x,
double[] y,
double[] sig)
|
PolynomialFitErrY(int order,
double[] x,
double[] y,
double[] sig,
boolean centered)
Creates and performs polynomial regression on weighted data set. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
residual
public double[] residual
PolynomialFitErrY
public PolynomialFitErrY(int order,
double[] x,
double[] y,
double[] sig,
boolean centered)
throws StatisticsException
- Creates and performs polynomial regression on weighted data set.
- Parameters:
x
- the x coordinates of the pointsy
- the y coordinates of the pointssig
- the error bars on the y coordinates
PolynomialFitErrY
public PolynomialFitErrY(int order,
double[] x,
double[] y,
double[] sig)
throws StatisticsException
PolynomialFitErrY
public PolynomialFitErrY(java.io.File batch,
java.io.File out,
boolean centered)
throws StatisticsException
getMeanX
public double getMeanX()
getFitCoefficients
public double[] getFitCoefficients()
getCoefficientErrors
public double[] getCoefficientErrors()
getAdjustedCoeffErrors
public double[] getAdjustedCoeffErrors()
getChiSq
public double getChiSq()
getReducedChiSq
public double getReducedChiSq()
getDegreesOfFreedom
public int getDegreesOfFreedom()
get_p_value
public double get_p_value()
calculateY
public double calculateY(double x)
calculateY
public UncertainNumber calculateY(UncertainNumber x)
throws StatisticsException
StatisticsException
getSlope
public double getSlope(double x)
calculateFitValue
public double calculateFitValue(int index)
invertFit
public PolynomialFitErrY invertFit(boolean centered)
throws StatisticsException
- Inverts x and y data sets. X error bars are determined using sigy/y ratios. Useful for
inverting linear calibrations of positive sets (e.g., silicon detector channel vs. energy).
StatisticsException
getCovarianceMatrix
public Matrix getCovarianceMatrix()
getAdjustedCovarMatrix
public Matrix getAdjustedCovarMatrix()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getNormalizedResidual
public double getNormalizedResidual(int index)
main
public static void main(java.lang.String[] args)
- Parameters:
args
- the command line arguments