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

java.lang.Object
  extended by org.jscience.physics.nuclear.kinematics.math.statistics.LinearFitErrXY
All Implemented Interfaces:
Function

public class LinearFitErrXY
extends java.lang.Object
implements Function

Code for fitting a line to data with error bars in both x and y.


Field Summary
 double a
          y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double b
          y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double chi2
          y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double dof
          Degrees of freedom = num data points - 2
 double q
          y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double siga
          y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double sigb
          y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 
Constructor Summary
LinearFitErrXY()
          Creates a new LinearFitErrXY object.
 
Method Summary
 void doFit(double[] x, double[] y, double[] sigx, double[] sigy)
          DOCUMENT ME!
 double getTranslation(double[] x, double[] dx)
          Calculates a value to translate the x's by to diagonalize the coefficient covariance matrix.
 double[] translate(double[] x, double[] dx)
          Return an array equal to x with its elements reduced the mean of x.
 double valueAt(double x)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

public double a
y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof


b

public double b
y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof


siga

public double siga
y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof


sigb

public double sigb
y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof


chi2

public double chi2
y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof


q

public double q
y=a+bx chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof


dof

public double dof
Degrees of freedom = num data points - 2

Constructor Detail

LinearFitErrXY

public LinearFitErrXY()
Creates a new LinearFitErrXY object.

Method Detail

doFit

public void doFit(double[] x,
                  double[] y,
                  double[] sigx,
                  double[] sigy)
           throws StatisticsException
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
sigx - DOCUMENT ME!
sigy - DOCUMENT ME!
Throws:
StatisticsException - DOCUMENT ME!

valueAt

public double valueAt(double x)
DOCUMENT ME!

Specified by:
valueAt in interface Function
Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

getTranslation

public double getTranslation(double[] x,
                             double[] dx)
Calculates a value to translate the x's by to diagonalize the coefficient covariance matrix.

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

translate

public double[] translate(double[] x,
                          double[] dx)
Return an array equal to x with its elements reduced the mean of x.

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