org.jscience.physics.nuclear.kinematics.math.statistics
Class PolynomialFitErrY

java.lang.Object
  extended by org.jscience.physics.nuclear.kinematics.math.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


Field Summary
 double[] residual
          DOCUMENT ME!
 
Constructor Summary
PolynomialFitErrY(java.io.File batch, java.io.File out, boolean centered)
          Creates a new PolynomialFitErrY object.
PolynomialFitErrY(int order, double[] x, double[] y, double[] sig)
          Creates a new PolynomialFitErrY object.
PolynomialFitErrY(int order, double[] x, double[] y, double[] sig, boolean centered)
          Creates and performs polynomial regression on weighted data set.
 
Method Summary
 double calculateFitValue(int index)
          DOCUMENT ME!
 double calculateY(double x)
          DOCUMENT ME!
 UncertainNumber calculateY(UncertainNumber x)
          DOCUMENT ME!
 double get_p_value()
          DOCUMENT ME!
 double[] getAdjustedCoeffErrors()
          DOCUMENT ME!
 Matrix getAdjustedCovarMatrix()
          DOCUMENT ME!
 double getChiSq()
          DOCUMENT ME!
 double[] getCoefficientErrors()
          DOCUMENT ME!
 Matrix getCovarianceMatrix()
          DOCUMENT ME!
 int getDegreesOfFreedom()
          DOCUMENT ME!
 double[] getFitCoefficients()
          DOCUMENT ME!
 double getMeanX()
          DOCUMENT ME!
 double getNormalizedResidual(int index)
          DOCUMENT ME!
 double getReducedChiSq()
          DOCUMENT ME!
 double getSlope(double x)
          DOCUMENT ME!
 PolynomialFitErrY invertFit(boolean centered)
          Inverts x and y data sets.
static void main(java.lang.String[] args)
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

residual

public double[] residual
DOCUMENT ME!

Constructor Detail

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 points
y - the y coordinates of the points
sig - the error bars on the y coordinates
Throws:
StatisticsException

PolynomialFitErrY

public PolynomialFitErrY(int order,
                         double[] x,
                         double[] y,
                         double[] sig)
                  throws StatisticsException
Creates a new PolynomialFitErrY object.

Parameters:
order - DOCUMENT ME!
x - DOCUMENT ME!
y - DOCUMENT ME!
sig - DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

PolynomialFitErrY

public PolynomialFitErrY(java.io.File batch,
                         java.io.File out,
                         boolean centered)
                  throws StatisticsException
Creates a new PolynomialFitErrY object.

Parameters:
batch - DOCUMENT ME!
out - DOCUMENT ME!
centered - DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!
Method Detail

getMeanX

public double getMeanX()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getFitCoefficients

public double[] getFitCoefficients()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getCoefficientErrors

public double[] getCoefficientErrors()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getAdjustedCoeffErrors

public double[] getAdjustedCoeffErrors()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getChiSq

public double getChiSq()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getReducedChiSq

public double getReducedChiSq()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getDegreesOfFreedom

public int getDegreesOfFreedom()
DOCUMENT ME!

Returns:
DOCUMENT ME!

get_p_value

public double get_p_value()
DOCUMENT ME!

Returns:
DOCUMENT ME!

calculateY

public double calculateY(double x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

calculateY

public UncertainNumber calculateY(UncertainNumber x)
                           throws StatisticsException
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException

getSlope

public double getSlope(double x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

calculateFitValue

public double calculateFitValue(int index)
DOCUMENT ME!

Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!

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).

Parameters:
centered - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

getCovarianceMatrix

public Matrix getCovarianceMatrix()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getAdjustedCovarMatrix

public Matrix getAdjustedCovarMatrix()
DOCUMENT ME!

Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

getNormalizedResidual

public double getNormalizedResidual(int index)
DOCUMENT ME!

Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!

main

public static void main(java.lang.String[] args)
DOCUMENT ME!

Parameters:
args - the command line arguments