|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hep.aida.ref.optimizer.minuit.MinuitCommands
Minuit commands.
Field Summary | |
protected static int |
DETAILED_OUTPUT
|
protected static int |
MATRIX_DIAGONAL_APPROX
|
protected static int |
MATRIX_FULL_ACCURATE
|
protected static int |
MATRIX_FULL_FORCED_POS
|
protected static int |
MATRIX_NOT_CALCULATED
The possible status of the covariance matrix |
protected static int |
MAXIMAL_OUTPUT
|
protected static int |
MIGRAD_MIN
|
protected static int |
MINIMAL_OUTPUT
|
protected static int |
MINIMIZE_MIN
|
protected static int |
NO_OUTPUT
The printout levels for the minimizer output are the following: |
protected static int |
NORMAL_OUTPUT
|
protected static int |
SIMPLEX_MIN
The different types of minimization. |
Constructor Summary | |
protected |
MinuitCommands(MinuitOptimizer theOptimizer)
Default constructor. |
Method Summary | |
protected double[][] |
calculateContour(String parName1,
String parName2)
Calculate the Error Matrix in the current configuration. |
protected double[][] |
calculateContour(String parName1,
String parName2,
int nPoints)
|
protected double[][] |
calculateContour(String parName1,
String parName2,
int nPoints,
double nSigmas)
|
static double[] |
evaluateDerivatives(double[] vars)
Evaluate the function's derivatives. |
static double |
evaluateFunction(double[] vars)
Evaluate the function. |
static void |
finalizeFunction()
Finalize the function after the fit is over. |
protected void |
fixVariable(String varName)
|
protected double[][] |
getCovarianceMatrix()
|
protected double |
getErrorDef()
Get the value of UP, the errorDefinition. |
protected int |
getNVariables()
Get the number of (released) variables in the minimization. |
protected int |
getStatus()
Get the status of the fit. |
static void |
initializeFunction()
Initialize the function. |
protected static void |
jmncont(int parNum1,
int parNum2,
int nPoints,
double[] xPoints,
double[] yPoints,
int[] nFound)
Get the two dimensional contour for the current configuration. |
protected static void |
jmnemat(double[] errorMatrix,
int nDim)
Get the covariance matrix. |
protected static void |
jmnerrs(int parNum,
double[] errors)
Get the current parameter's errors. |
protected static int |
jmnexcm(String command,
double[] argList,
int nArg)
Execute a Minuit command, the command is executed on the current function. |
protected static void |
jmninit(int inputUnit,
int outputUnit,
int saveUnit)
Initialize minuit. |
protected static int |
jmnparm(int parNum,
String parName,
double parValue,
double stepSize,
double minValue,
double maxValue)
Define a new fit parameter. |
protected static int |
jmnpout(int parNum,
String[] parName,
double[] parVals)
Get the current value of a parameter. |
protected static void |
jmnseti(String title)
Set the title of the minimization session. |
protected static int |
jmnstat(double[] vals,
int[] pars)
Get the current status of minimization. |
protected void |
minos()
Perform the Minos error analysis on the specified variables. |
protected void |
optimize(String method,
int maxIterations,
double tolerance)
Minimize the function. |
protected void |
resetMinuit()
Reset Minuit. |
protected void |
setErrorDef(int errDef)
Set the Error Definition, the Minuit UP value. |
protected void |
setErrorDefinition(double errDef)
|
protected void |
setFunction(hep.aida.IFunction function,
MinuitOptimizer optimizer)
Set the function to be minimized. |
protected void |
setPrecision(double precision)
Informs Minuit on the machin precision. |
void |
setPrintLevel(int printLevel)
|
protected void |
setStrategy(int strategy)
Set the strategy to be used in calculating the first and second derivative and in certain optimization methods. |
protected void |
setUseFunctionGradient(boolean useFunctionGradient)
Tell Minuit if the derivatives provided by the function are to be used. |
protected void |
updateFunction(MinuitOptimizer optimizer)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int MATRIX_NOT_CALCULATED
protected static final int MATRIX_DIAGONAL_APPROX
protected static final int MATRIX_FULL_FORCED_POS
protected static final int MATRIX_FULL_ACCURATE
protected static final int NO_OUTPUT
protected static final int MINIMAL_OUTPUT
protected static final int NORMAL_OUTPUT
protected static final int DETAILED_OUTPUT
protected static final int MAXIMAL_OUTPUT
protected static final int SIMPLEX_MIN
protected static final int MIGRAD_MIN
protected static final int MINIMIZE_MIN
Constructor Detail |
protected MinuitCommands(MinuitOptimizer theOptimizer)
Method Detail |
protected static void jmninit(int inputUnit, int outputUnit, int saveUnit)
inputUnit
- Unit number for input to Minuit (default 5)outputUnit
- Unit number for output from Minuit (default 6)saveUnit
- Unit number to be used for SAVE command (default 7)protected static void jmnseti(String title)
title
- The title.protected static int jmnparm(int parNum, String parName, double parValue, double stepSize, double minValue, double maxValue)
parNum
- The parameter number (+1) as referenced by the IFunction to be
minimized.parName
- The parameter's name. (maximum 10 characters).parValue
- The parameter's starting value.stepSize
- Starting step size or approximate error.minValue
- The parameter's lower limit.maxValue
- The parameter's upper limit. If the upper and the lower limits are set to 0,
the parameter is considered unbounded.
protected static int jmnexcm(String command, double[] argList, int nArg)
command
- The Minuit command to be executed.argList
- Array containing the numeric arguments to the command.nArg
- The number of arguments specified.
protected static int jmnpout(int parNum, String[] parName, double[] parVals)
parNum
- The parameter's number (+1) as referenced in the function to be minimized.parName
- The parameter's name (it is a one dimensional array);parVals
- The parameter's values. This array contains four entries: the
current value of the parameter, the current error on the parameter,
the parameter's lower and upper bound (both 0 if parameter is unbounded).
protected static int jmnstat(double[] vals, int[] pars)
vals
- The values of the minimization. This array contains the following three
entries: the current best value of the function, the estimated vertical distance
to the minimum, the value of UP defining the errors.pars
- The parameters information. This array contains the following two entries:
the number of variables in the fit, the highest parameter number (as seen
by the function to be minimized).
protected static void jmnemat(double[] errorMatrix, int nDim)
errorMatrix
- The error matrix. It is an array of length nDim*nDimnDim
- The dimension of the error matrix (at least the number of free variables).protected static void jmnerrs(int parNum, double[] errors)
parNum
- The parameter's number; if positive it is the number as referenced
by the function to be minimized, if negative it is the negative of the
parameter number as used within Minuit (the internal representation)errors
- The parameter's errors. This array has four entries: the positive MINOS
error, the negative MINOS error, the parabolic error from the error matrix
and the global correlation coerricient.protected static void jmncont(int parNum1, int parNum2, int nPoints, double[] xPoints, double[] yPoints, int[] nFound)
parNum1
- The external number of the first parameter.parNum2
- The external number of the second parameter.nPoints
- The number of points that are to be calculated on the contour (>4).xPoints
- The array of the x-coordinate of the found points.yPoints
- The array of the y-coordinate of the found points.nFound
- The number of points that have been found. This is a 1-dimensional array.public void setPrintLevel(int printLevel) throws IllegalArgumentException
IllegalArgumentException
protected void resetMinuit()
public static double evaluateFunction(double[] vars)
vars
- The values of the parameters where the function has to be evaluated.
public static double[] evaluateDerivatives(double[] vars)
vars
- The values of the parameters where the function's derivatives have to be evaluated.
public static void initializeFunction()
public static void finalizeFunction()
protected void setFunction(hep.aida.IFunction function, MinuitOptimizer optimizer)
function
- The function to be minimized.protected void updateFunction(MinuitOptimizer optimizer)
protected void fixVariable(String varName)
protected int getStatus()
protected int getNVariables()
protected double getErrorDef()
protected void setErrorDef(int errDef)
errDef
- The new value for the Error Definitionprotected void setErrorDefinition(double errDef)
protected void setUseFunctionGradient(boolean useFunctionGradient)
protected void setStrategy(int strategy)
protected void setPrecision(double precision)
protected void optimize(String method, int maxIterations, double tolerance)
method
- The optimization method. It can be:
- SIMPLEX performs a minimixation using the simplex method of
Nedler and Mead. The minimization will stop after maxIter call have
been performed or when the EDM is less than the tolerance (default
is 0.1*UP)
- MIGRAD The default minimization using the Migrad method. maxIter is the (optional)
maximum amount of iterations; when this is reached the minimization will
stopped even if it did not converge. The minimization converges when
the EDM is less than 0.001*tolerance*UP.
- MINIMIZE It starts by using the MIGRAD minimization; it this
does not converge it switches to the SIMPLEX method.
- IMPROVE If a previous minimization has converged and the function is in
and optimal solution, it searches for additional global optimal points.
The calculation will be stopped after maxIterations calls.
- SEEK Causes a Monte Carlo minimization of the function, by choosing uniformely random values
of the variables in an hypercube centered in the current variable values. The size of the
hypercube is specified by the value of tolerance.maxIterations
- The maximum amount of allowed iterations.tolerance
- The tolerance for the minimization.
true
if the command was successfull; false
otherwise.
Check the status of the minimization to know what went wrong.protected void minos()
true
if the command was successfull; false
otherwise.
Check the status of the minimization to know what went wrong.
protected double[][] calculateContour(String parName1, String parName2)
true
if the error matrix was calculated successfully.
false
otherwise.protected double[][] calculateContour(String parName1, String parName2, int nPoints)
protected double[][] calculateContour(String parName1, String parName2, int nPoints, double nSigmas)
protected double[][] getCovarianceMatrix()
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |