dwvisser.analysis
Class LevenbergMarquadt

java.lang.Object
  |
  +--dwvisser.analysis.LevenbergMarquadt

public class LevenbergMarquadt
extends java.lang.Object

This uses the Levenberg-Marquadt prescription for finding the local minimum of chi-squared given seed parameter values for the function to fit. The NonLinearFit class which creates and calls this must supply the function evaluation and differentiation.

Version:
0.5, 8/28/98
Author:
Dale Visser
See Also:
NonLinearFit, GaussianFit

Field Summary
static int FIRST_ITERATION
          int used when calling to calculate the first iteration
static int LAST_ITERATION
          int used when calling to calculate the last iteration
static int NEXT_ITERATION
          int used when calling to calculate subsequent iterations
 
Constructor Summary
LevenbergMarquadt(NonLinearFit nlf)
          Class constructor giving handle to parent.
 
Method Summary
 double getChiSq()
          Gives the chi-sqared value of the latest iteration.
 int getDegreesOfFreedom()
           
 void iterate(int iteration)
          Calculates a single iteration of the minimization routine.
 void setup(double[] counts, double[] errors, int minChannel, int maxChannel)
          Sets the histogram values and the boundaries for the fit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_ITERATION

public static final int FIRST_ITERATION
int used when calling to calculate the first iteration

See Also:
Constant Field Values

NEXT_ITERATION

public static final int NEXT_ITERATION
int used when calling to calculate subsequent iterations

See Also:
Constant Field Values

LAST_ITERATION

public static final int LAST_ITERATION
int used when calling to calculate the last iteration

See Also:
Constant Field Values
Constructor Detail

LevenbergMarquadt

public LevenbergMarquadt(NonLinearFit nlf)
Class constructor giving handle to parent.

Parameters:
nlf - the parent NonLinearFit object creating this
Method Detail

setup

public void setup(double[] counts,
                  double[] errors,
                  int minChannel,
                  int maxChannel)
Sets the histogram values and the boundaries for the fit.

Parameters:
counts - the counts in the histogram to fit
minChannel - the lower limit of the fit
maxChannel - the upper limit of the fit

iterate

public void iterate(int iteration)
             throws java.lang.Exception
Calculates a single iteration of the minimization routine.

Parameters:
iteration - indicates first, middle, or final iteration
Throws:
java.lang.Exception - trying to diagonalize singular matrices
See Also:
FIRST_ITERATION, NEXT_ITERATION, LAST_ITERATION, NonLinearFit.doFit()

getChiSq

public double getChiSq()
Gives the chi-sqared value of the latest iteration.

Returns:
chiSq/dof

getDegreesOfFreedom

public int getDegreesOfFreedom()