jasext.hist.fitter
Class LeastSquaresFit

java.lang.Object
  |
  +--java.util.Observable
        |
        +--jas.hist.Fitter
              |
              +--jasext.hist.fitter.LeastSquaresFit
All Implemented Interfaces:
java.util.Observer, java.lang.Runnable, java.io.Serializable

public class LeastSquaresFit
extends Fitter

See Also:
Serialized Form

Fields inherited from class jas.hist.Fitter
FAILED, FIT, FITTING, NOTREADYTOFIT, OUTAHERE, READYTOFIT
 
Constructor Summary
LeastSquaresFit()
           
 
Method Summary
 void fit(Fittable1DFunction func, double[] x, double[] y, double[] sigmaY)
          This algorithm based on CURFIT program from "Data Reduction and Error Analysis for the Physical Sciences" by Philip R Bevington, Page 237.
 double getChiSquared()
           
 double[] getParameterSigmas()
           
 
Methods inherited from class jas.hist.Fitter
dispose, fit, getData, getFunction, getState, run, setData, setFunction, setPercentComplete, start, stop, update
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeastSquaresFit

public LeastSquaresFit()
Method Detail

fit

public void fit(Fittable1DFunction func,
                double[] x,
                double[] y,
                double[] sigmaY)
         throws FitFailed
This algorithm based on CURFIT program from "Data Reduction and Error Analysis for the Physical Sciences" by Philip R Bevington, Page 237. It performs a least squared fit using the Marquardt algorithm.
Overrides:
fit in class Fitter
Parameters:
func - The function to be fit
x - The x values of the points to be fit
y - The y values of the points to be fit
sigmaY - The errors (assumed symmetric) on the y values
Throws:
FitFailed - if the fit was not successful

getChiSquared

public double getChiSquared()
Overrides:
getChiSquared in class Fitter

getParameterSigmas

public double[] getParameterSigmas()
Overrides:
getParameterSigmas in class Fitter