dwvisser.statistics
Class LinearFitErrXY

java.lang.Object
  |
  +--dwvisser.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.

Author:
Dale W Visser

Field Summary
 double a
          y=a+b*x chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double b
          y=a+b*x chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double chi2
          y=a+b*x 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+b*x chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double siga
          y=a+b*x chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 double sigb
          y=a+b*x chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof
 
Constructor Summary
LinearFitErrXY()
           
 
Method Summary
 void doFit(double[] x, double[] y, double[] sigx, double[] sigy)
           
 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)
          Evaluate the function.
 
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+b*x chi2=full chi2 not reduced q=probability of good fit based on chi2 and dof


b

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


siga

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


sigb

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


chi2

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


q

public double q
y=a+b*x 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()
Method Detail

doFit

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

valueAt

public double valueAt(double x)
Description copied from interface: Function
Evaluate the function.

Specified by:
valueAt in interface Function
Returns:
value of the function at x

getTranslation

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


translate

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