joptima
Class Fitter
- java.lang.Object
-
- joptima.Fitter
-
- All Implemented Interfaces:
- Function, Minimizable
- Direct Known Subclasses:
- ChiSquaredFitter, ChiSquaredFitter2D
public abstract class Fitter extends java.lang.Object implements Minimizable, Function
An abstract fitter.Extensions of this class typically need to do the following:
- provide the appropriate setData() methods or some other way of handling the measured data points;
- override the addFunction() method if fitting children of
Functionor something entirely different; - implement the
Minimizable.calculate()method to calculate the value of the appropriate likelihood function, given the data points and the set ofFunctions.
-
-
Constructor Summary
Constructors Constructor and Description Fitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddFunction(Function f)doublecalculate(double x)Returns the value of the sum of functions at the given point.java.lang.StringgetName()Returns a function name for this fitter.Parameter[]getParameters()voidremoveAllFunctions()voidsetName(java.lang.String newname)Sets the function name for this fitter.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface joptima.Minimizable
calculate
-
-
-
-
Method Detail
-
addFunction
public void addFunction(Function f)
-
removeAllFunctions
public void removeAllFunctions()
-
calculate
public double calculate(double x)
Returns the value of the sum of functions at the given point. Useful for plotting the fitted function after the fit converges.
-
getName
public java.lang.String getName()
Returns a function name for this fitter. By default the name is created from the names of all functions. If setName() was called, that is returned instead.
-
setName
public void setName(java.lang.String newname)
Sets the function name for this fitter.
-
getParameters
public Parameter[] getParameters()
Creates a list of all theFunctionparameters for thisFitter. This method retrieves the parameters lists from individualFunctions and copies them into a single array to pass to aMinimizer.- Specified by:
getParametersin interfaceFunction- Specified by:
getParametersin interfaceMinimizable- Returns:
- a
Parameter[] of delegates that access the proper member variables.
-
-
DMelt 3.0 © DataMelt by jWork.ORG