hep.aida
Interface IFitter
-
- All Known Subinterfaces:
- IDevFitter, IExtFitter
- All Known Implementing Classes:
- Fitter
public interface IFitterFitter 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.lang.String[]constraints()IDataPointSetcreateContour(IFitData d, IFitResult r, java.lang.String par1, java.lang.String par2, int npts, double up)IDataPointSetcreateScan1D(IFitData d, IFunction f, java.lang.String par, int npts, double pmin, double pmax)java.lang.StringengineName()Get the name of the engine currently in use.IFitResultfit(IBaseHistogram hist, IFunction func)Shortcut to fit an IBaseHistogram directly with an IFunction.IFitResultfit(IBaseHistogram hist, IFunction func, java.lang.String range)Shortcut to fit an IBaseHistogram directly with an IFunction.IFitResultfit(IBaseHistogram hist, java.lang.String model)Shortcut to fit an IBaseHistogram directly with an IFunction.IFitResultfit(IBaseHistogram hist, java.lang.String model, double[] initialParameters)Shortcut to fit an IBaseHistogram directly with an IFunction.IFitResultfit(IBaseHistogram hist, java.lang.String model, double[] initialParameters, java.lang.String range)Shortcut to fit an IBaseHistogram directly with an IFunction.IFitResultfit(IBaseHistogram hist, java.lang.String model, java.lang.String range)Shortcut to fit an IBaseHistogram directly with an IFunction.IFitResultfit(IDataPointSet dataPointSet, IFunction f)Shortcut to fit an IDataPointSet directly with an IFunction.IFitResultfit(IDataPointSet dataPointSet, IFunction f, java.lang.String range)Shortcut to fit an IDataPointSet directly with an IFunction.IFitResultfit(IDataPointSet dataPointSet, java.lang.String model)Shortcut to fit an IDataPointSet directly with an IFunction.IFitResultfit(IDataPointSet dataPointSet, java.lang.String model, double[] initialParameters)Shortcut to fit an IDataPointSet directly with an IFunction.IFitResultfit(IDataPointSet dataPointSet, java.lang.String model, double[] initialParameters, java.lang.String range)Shortcut to fit an IDataPointSet directly with an IFunction.IFitResultfit(IDataPointSet dataPointSet, java.lang.String model, java.lang.String range)Shortcut to fit an IDataPointSet directly with an IFunction.IFitResultfit(IFitData fitData, IFunction func)Fit an IFunction to an IFitData.IFitResultfit(IFitData fitData, IFunction func, java.lang.String range)Fit an IFunction to an IFitData.IFitResultfit(IFitData d, java.lang.String model)Fit a given model to an IFitData.IFitResultfit(IFitData d, java.lang.String model, double[] initialParameters)Fit a given model to an IFitData.IFitResultfit(IFitData d, java.lang.String model, double[] initialParameters, java.lang.String range)Fit a given model to an IFitData.IFitResultfit(IFitData d, java.lang.String model, java.lang.String range)Fit a given model to an IFitData.java.lang.StringfitMethodName()Get the name of the fit method currently in use.IFitParameterSettingsfitParameterSettings(java.lang.String name)Access to fit parameter settings.java.lang.String[]listParameterSettings()Get a vector of names of all parameter settings defined in the fitter.voidresetConstraints()Reset all the constraints.voidresetParameterSettings()Reset all parameter settings which fitter remebers.voidsetConstraint(java.lang.String expr)Set a general constraint in the parameter space.voidsetEngine(java.lang.String name)Set the optimization engine which is used internally for fitting.voidsetFitMethod(java.lang.String name)Set the fit method type.voidsetUseFunctionGradient(boolean useGrad)Choose between using or not using the analytical derivatives if provided by the function.booleanuseFunctionGradient()Check if the IFitter is set to use the analytical derivatives provided by the IFunction.
-
-
-
Method Detail
-
fit
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
IFitResult fit(IFitData fitData, IFunction func, java.lang.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
IFitResult fit(IFitData d, java.lang.String model)
Fit a given model to an IFitData. The result of the fit is an IFitResult.- Parameters:
fitData- The IFitData 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 results of the fit.
-
fit
IFitResult fit(IFitData d, java.lang.String model, java.lang.String range)
Fit a given model to an IFitData. The result of the fit is an IFitResult.- Parameters:
fitData- The IFitData 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 results of the fit.
-
fit
IFitResult fit(IFitData d, java.lang.String model, double[] initialParameters)
Fit a given model to an IFitData. The result of the fit is an IFitResult.- Parameters:
fitData- The IFitData 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 results of the fit.
-
fit
IFitResult fit(IFitData d, java.lang.String model, double[] initialParameters, java.lang.String range)
Fit a given model to an IFitData. The result of the fit is an IFitResult.- Parameters:
fitData- The IFitData 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 results of the fit.
-
fit
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
IFitResult fit(IBaseHistogram hist, IFunction func, java.lang.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
IFitResult fit(IBaseHistogram hist, java.lang.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
IFitResult fit(IBaseHistogram hist, java.lang.String model, java.lang.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
IFitResult fit(IBaseHistogram hist, java.lang.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
IFitResult fit(IBaseHistogram hist, java.lang.String model, double[] initialParameters, java.lang.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
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.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
IFitResult fit(IDataPointSet dataPointSet, IFunction f, java.lang.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.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
IFitResult fit(IDataPointSet dataPointSet, java.lang.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
IFitResult fit(IDataPointSet dataPointSet, java.lang.String model, java.lang.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
IFitResult fit(IDataPointSet dataPointSet, java.lang.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
IFitResult fit(IDataPointSet dataPointSet, java.lang.String model, double[] initialParameters, java.lang.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
void setEngine(java.lang.String name) throws java.lang.IllegalArgumentExceptionSet 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:
java.lang.IllegalArgumentException- If the name does not correspond to a valid engine.
-
engineName
java.lang.String engineName()
Get the name of the engine currently in use.- Returns:
- The name of the optimizer engine used by the IFitter.
-
fitParameterSettings
IFitParameterSettings fitParameterSettings(java.lang.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
java.lang.String[] listParameterSettings()
Get a vector of names of all parameter settings defined in the fitter.
-
resetParameterSettings
void resetParameterSettings()
Reset all parameter settings which fitter remebers.
-
setConstraint
void setConstraint(java.lang.String expr) throws java.lang.IllegalArgumentExceptionSet a general constraint in the parameter space. The constraint is a parsed expression. PENDING: The syntax to be fixed.- Throws:
java.lang.IllegalArgumentException
-
constraints
java.lang.String[] constraints()
-
resetConstraints
void resetConstraints()
Reset all the constraints.
-
setFitMethod
void setFitMethod(java.lang.String name) throws java.lang.IllegalArgumentExceptionSet 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:
java.lang.IllegalArgumentException- If the name does not correspond to a valid fit method.
-
fitMethodName
java.lang.String fitMethodName()
Get the name of the fit method currently in use.- Returns:
- The name of the fit method.
-
createScan1D
IDataPointSet createScan1D(IFitData d, IFunction f, java.lang.String par, int npts, double pmin, double pmax)
-
createContour
IDataPointSet createContour(IFitData d, IFitResult r, java.lang.String par1, java.lang.String par2, int npts, double up)
-
setUseFunctionGradient
void setUseFunctionGradient(boolean useGrad) throws java.lang.IllegalArgumentExceptionChoose between using or not using the analytical derivatives if provided by the function.- Parameters:
useGrad- Iftruethe IFitter will use the analytical derivatives if provided by the IFunction.- Throws:
java.lang.IllegalArgumentException
-
useFunctionGradient
boolean useFunctionGradient()
Check if the IFitter is set to use the analytical derivatives provided by the IFunction.- Returns:
trueif the IFitter uses the analytical derivatives.
-
-
DMelt 3.0 © DataMelt by jWork.ORG