AIDA API
Version 3.3

hep.aida
Interface IFitter


public interface IFitter

Fitter performs fits, scans and computes contours. Fitter never stores association to the data and functions which are used for fitting. Results of the fit are availabe in the IFitResult object, which also remebers the initial fit configuration.

Author:
The AIDA team (http://aida.freehep.org/)

Method Summary
 String[] constraints()
           
 IDataPointSet createContour(IFitData d, IFitResult r, String par1, String par2, int npts, double up)
           
 IDataPointSet createScan1D(IFitData d, IFunction f, String par, int npts, double pmin, double pmax)
           
 String engineName()
          Get the name of the engine currently in use.
 IFitResult fit(IBaseHistogram hist, IFunction func)
          Shortcut to fit an IBaseHistogram directly with an IFunction.
 IFitResult fit(IBaseHistogram hist, IFunction func, String range)
          Shortcut to fit an IBaseHistogram directly with an IFunction.
 IFitResult fit(IBaseHistogram hist, String model)
          Shortcut to fit an IBaseHistogram directly with an IFunction.
 IFitResult fit(IBaseHistogram hist, String model, double[] initialParameters)
          Shortcut to fit an IBaseHistogram directly with an IFunction.
 IFitResult fit(IBaseHistogram hist, String model, double[] initialParameters, String range)
          Shortcut to fit an IBaseHistogram directly with an IFunction.
 IFitResult fit(IBaseHistogram hist, String model, String range)
          Shortcut to fit an IBaseHistogram directly with an IFunction.
 IFitResult fit(IDataPointSet dataPointSet, IFunction f)
          Shortcut to fit an IDataPointSet directly with an IFunction.
 IFitResult fit(IDataPointSet dataPointSet, IFunction f, String range)
          Shortcut to fit an IDataPointSet directly with an IFunction.
 IFitResult fit(IDataPointSet dataPointSet, String model)
          Shortcut to fit an IDataPointSet directly with an IFunction.
 IFitResult fit(IDataPointSet dataPointSet, String model, double[] initialParameters)
          Shortcut to fit an IDataPointSet directly with an IFunction.
 IFitResult fit(IDataPointSet dataPointSet, String model, double[] initialParameters, String range)
          Shortcut to fit an IDataPointSet directly with an IFunction.
 IFitResult fit(IDataPointSet dataPointSet, String model, String range)
          Shortcut to fit an IDataPointSet directly with an IFunction.
 IFitResult fit(IFitData fitData, IFunction func)
          Fit an IFunction to an IFitData.
 IFitResult fit(IFitData fitData, IFunction func, String range)
          Fit an IFunction to an IFitData.
 IFitResult fit(IFitData d, String model)
          Fit a given model to an IFitData.
 IFitResult fit(IFitData d, String model, double[] initialParameters)
          Fit a given model to an IFitData.
 IFitResult fit(IFitData d, String model, double[] initialParameters, String range)
          Fit a given model to an IFitData.
 IFitResult fit(IFitData d, String model, String range)
          Fit a given model to an IFitData.
 String fitMethodName()
          Get the name of the fit method currently in use.
 IFitParameterSettings fitParameterSettings(String name)
          Access to fit parameter settings.
 String[] listParameterSettings()
          Get a vector of names of all parameter settings defined in the fitter.
 void resetConstraints()
          Reset all the constraints.
 void resetParameterSettings()
          Reset all parameter settings which fitter remebers.
 void setConstraint(String expr)
          Set a general constraint in the parameter space.
 void setEngine(String name)
          Set the optimization engine which is used internally for fitting.
 void setFitMethod(String name)
          Set the fit method type.
 void setUseFunctionGradient(boolean useGrad)
          Choose between using or not using the analytical derivatives if provided by the function.
 boolean useFunctionGradient()
          Check if the IFitter is set to use the analytical derivatives provided by the IFunction.
 

Method Detail

fit

public IFitResult fit(IFitData fitData,
                      IFunction func)
Fit an IFunction to an IFitData. The result of the fit is an IFitResult.

Parameters:
fitData - The IFitData to be fitted.
func - The IFunction to fit on the data. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the results of the fit.

fit

public IFitResult fit(IFitData fitData,
                      IFunction func,
                      String range)
Fit an IFunction to an IFitData. The result of the fit is an IFitResult.

Parameters:
fitData - The IFitData to be fitted.
func - The IFunction to fit on the data.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the results of the fit.

fit

public IFitResult fit(IFitData d,
                      String model)
Fit a given model to an IFitData. The result of the fit is an IFitResult.

Parameters:
model - The string defining the function to be used. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the results of the fit.

fit

public IFitResult fit(IFitData d,
                      String model,
                      String range)
Fit a given model to an IFitData. The result of the fit is an IFitResult.

Parameters:
model - The string defining the function to be used.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the results of the fit.

fit

public IFitResult fit(IFitData d,
                      String model,
                      double[] initialParameters)
Fit a given model to an IFitData. The result of the fit is an IFitResult.

Parameters:
model - The string defining the function to be used.
initialParameters - The array of the initial parameter values; its size must match the number of parameters in the function. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the results of the fit.

fit

public IFitResult fit(IFitData d,
                      String model,
                      double[] initialParameters,
                      String range)
Fit a given model to an IFitData. The result of the fit is an IFitResult.

Parameters:
model - The string defining the function to be used.
initialParameters - The array of the initial parameter values; its size must match the number of parameters in the function.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the results of the fit.

fit

public IFitResult fit(IBaseHistogram hist,
                      IFunction func)
Shortcut to fit an IBaseHistogram directly with an IFunction. The dimension of the IBaseHistogram must match the dimension of the IFunction. IHistograms and IProfiles are for binned fits only, IClouds only for unbinned fits.

Parameters:
hist - The IBaseHistogram to be fitted.
func - The IFunction to fit on the data. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IBaseHistogram hist,
                      IFunction func,
                      String range)
Shortcut to fit an IBaseHistogram directly with an IFunction. The dimension of the IBaseHistogram must match the dimension of the IFunction. IHistograms and IProfiles are for binned fits only, IClouds only for unbinned fits.

Parameters:
hist - The IBaseHistogram to be fitted.
func - The IFunction to fit on the data.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IBaseHistogram hist,
                      String model)
Shortcut to fit an IBaseHistogram directly with an IFunction. The dimension of the IBaseHistogram must match the dimension of the IFunction. IHistograms and IProfiles are for binned fits only, IClouds only for unbinned fits.

Parameters:
hist - The IBaseHistogram to be fitted.
model - The string defining the function to be used. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IBaseHistogram hist,
                      String model,
                      String range)
Shortcut to fit an IBaseHistogram directly with an IFunction. The dimension of the IBaseHistogram must match the dimension of the IFunction. IHistograms and IProfiles are for binned fits only, IClouds only for unbinned fits.

Parameters:
hist - The IBaseHistogram to be fitted.
model - The string defining the function to be used.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IBaseHistogram hist,
                      String model,
                      double[] initialParameters)
Shortcut to fit an IBaseHistogram directly with an IFunction. The dimension of the IBaseHistogram must match the dimension of the IFunction. IHistograms and IProfiles are for binned fits only, IClouds only for unbinned fits.

Parameters:
hist - The IBaseHistogram to be fitted.
model - The string defining the function to be used.
initialParameters - The array of the initial parameter values; its size must match the number of parameters in the function. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IBaseHistogram hist,
                      String model,
                      double[] initialParameters,
                      String range)
Shortcut to fit an IBaseHistogram directly with an IFunction. The dimension of the IBaseHistogram must match the dimension of the IFunction. IHistograms and IProfiles are for binned fits only, IClouds only for unbinned fits.

Parameters:
hist - The IBaseHistogram to be fitted.
model - The string defining the function to be used.
initialParameters - The array of the initial parameter values; its size must match the number of parameters in the function.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IDataPointSet dataPointSet,
                      IFunction f)
Shortcut to fit an IDataPointSet directly with an IFunction. The dimension of the IDataPointSet must be equal the dimension of the IFunction + 1. This are binned fits only; the last coordinate of the IDataPointSet is used as the "height" in a fit to an IBaseHistogram.

Parameters:
dataPointSet - The IDataPointSet to be fitted.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IDataPointSet dataPointSet,
                      IFunction f,
                      String range)
Shortcut to fit an IDataPointSet directly with an IFunction. The dimension of the IDataPointSet must be equal the dimension of the IFunction + 1. This are binned fits only; the last coordinate of the IDataPointSet is used as the "height" in a fit to an IBaseHistogram.

Parameters:
dataPointSet - The IDataPointSet to be fitted.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IDataPointSet dataPointSet,
                      String model)
Shortcut to fit an IDataPointSet directly with an IFunction. The dimension of the IDataPointSet must be equal the dimension of the IFunction + 1. This are binned fits only; the last coordinate of the IDataPointSet is used as the "height" in a fit to an IBaseHistogram.

Parameters:
dataPointSet - The IDataPointSet to be fitted.
model - The string defining the function to be used. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IDataPointSet dataPointSet,
                      String model,
                      String range)
Shortcut to fit an IDataPointSet directly with an IFunction. The dimension of the IDataPointSet must be equal the dimension of the IFunction + 1. This are binned fits only; the last coordinate of the IDataPointSet is used as the "height" in a fit to an IBaseHistogram.

Parameters:
dataPointSet - The IDataPointSet to be fitted.
model - The string defining the function to be used.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IDataPointSet dataPointSet,
                      String model,
                      double[] initialParameters)
Shortcut to fit an IDataPointSet directly with an IFunction. The dimension of the IDataPointSet must be equal the dimension of the IFunction + 1. This are binned fits only; the last coordinate of the IDataPointSet is used as the "height" in a fit to an IBaseHistogram.

Parameters:
dataPointSet - The IDataPointSet to be fitted.
model - The string defining the function to be used.
initialParameters - The array of the initial parameter values; its size must match the number of parameters in the function. multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

fit

public IFitResult fit(IDataPointSet dataPointSet,
                      String model,
                      double[] initialParameters,
                      String range)
Shortcut to fit an IDataPointSet directly with an IFunction. The dimension of the IDataPointSet must be equal the dimension of the IFunction + 1. This are binned fits only; the last coordinate of the IDataPointSet is used as the "height" in a fit to an IBaseHistogram.

Parameters:
dataPointSet - The IDataPointSet to be fitted.
model - The string defining the function to be used.
initialParameters - The array of the initial parameter values; its size must match the number of parameters in the function.
range - The range over which to perform the fit. It is possible to spedify multiple ranges for more than one dimension: "x:(-1.,0.),(2.,3.) y:(-5,5)" For a 1-d fit it is possible to omit the axis label: "(-1,0),(2,3.)". Open ranges are defined by omitting the desired bound: "(,0)" or "(0,)" stand for less than zero and greater than zero respectively.
Returns:
The IFitResult containing the result of the fit.

setEngine

public void setEngine(String name)
               throws IllegalArgumentException
Set the optimization engine which is used internally for fitting.

Parameters:
name - The name of the optimizer engine. Examples of predefined engines: "minuit". The engine name is case-insensitive. Different engines are provided by different implementations.
Throws:
IllegalArgumentException - If the name does not correspond to a valid engine.

engineName

public String engineName()
Get the name of the engine currently in use.

Returns:
The name of the optimizer engine used by the IFitter.

fitParameterSettings

public IFitParameterSettings fitParameterSettings(String name)
Access to fit parameter settings. FitParameterSettings object belongs to and is managed by the fitter. Fitter implementation takes care that the returned reference is valid thru the lifetime of fitter. User can set the settings of the parameters independently of the parameters of the fitted function. Setting for parameters unknown in the function and set in the fitter are ignored in the fit. If settings are not explicitly set in the fitter, their default values are attached to function parameters during the fit.


listParameterSettings

public String[] listParameterSettings()
Get a vector of names of all parameter settings defined in the fitter.


resetParameterSettings

public void resetParameterSettings()
Reset all parameter settings which fitter remebers.


setConstraint

public void setConstraint(String expr)
                   throws IllegalArgumentException
Set a general constraint in the parameter space. The constraint is a parsed expression. PENDING: The syntax to be fixed.

Throws:
IllegalArgumentException

constraints

public String[] constraints()

resetConstraints

public void resetConstraints()
Reset all the constraints.


setFitMethod

public void setFitMethod(String name)
                  throws IllegalArgumentException
Set the fit method type. Examples of pre-defined methods: "chi2", "ml". The method names are case-insensitive.

Parameters:
name - The name of the fit method.
Throws:
IllegalArgumentException - If the name does not correspond to a valid fit method.

fitMethodName

public String fitMethodName()
Get the name of the fit method currently in use.

Returns:
The name of the fit method.

createScan1D

public IDataPointSet createScan1D(IFitData d,
                                  IFunction f,
                                  String par,
                                  int npts,
                                  double pmin,
                                  double pmax)

createContour

public IDataPointSet createContour(IFitData d,
                                   IFitResult r,
                                   String par1,
                                   String par2,
                                   int npts,
                                   double up)

setUseFunctionGradient

public void setUseFunctionGradient(boolean useGrad)
                            throws IllegalArgumentException
Choose between using or not using the analytical derivatives if provided by the function.

Parameters:
useGrad - If true the IFitter will use the analytical derivatives if provided by the IFunction.
Throws:
IllegalArgumentException

useFunctionGradient

public boolean useFunctionGradient()
Check if the IFitter is set to use the analytical derivatives provided by the IFunction.

Returns:
true if the IFitter uses the analytical derivatives.

AIDA API
Version 3.3

Copyright © 2000-2004 AIDA Team, All Rights Reserved.