Ivan Reid, PSI mSR Facility Aug 21, 2000 These notes are as much a help to myself as to anyone else. I did write something similar at TRIUMF many years ago, but that was pre-LAT EX, so the maths was hand-written and never survived.
Calculating derivativesThe most powerful feature of MINUIT is the MIGRAD minimisation routine. However, this procedure requires the gradients of the minimisation function with respect to all the parameters; i.e. the partial derivatives. It is obviously much more efficient to supply these within the user-written function (called generically FCN) than to have MINUIT calculate them by successively varying each parameter.
In general, the function being minimised is a c2 sum:
and the gradients are the partial derivatives ¶S/¶pn with respect to the parameters pn:
Note that if the data have been averaged over k bins, as I am
currently doing with MINFIT so that the normalisation and background
remain constant despite packing, the above derivation needs to be corrected.
The true c2 sum in this case is
For mSR data, the theory functions take the form
For the case now where f(t) = åm am gm(t), which again corresponds
to mSR experiments,
I have written the ``new'' MINUIT fitting routines based on the above treatment. Firstly, there are several discrete ``functions'' based on a full implementation of c2 and derivative calculations. These are (or at least can be) the most efficient implementations, but must be tailor-made for each separate new combination of signals. For these, I have defined two types of the parameters pn. The first are ``global'' parameters which are true for all histograms, such as magnetic field and relaxation parameters, while the second type are those which pertain to individual histograms, such as normalisation, background, amplitudes, phases, etc. Each separate function has a name associated with it (I have made heavy use of VAX FORTRAN's STRUCTURE facility to associate properties belonging to each function) whic h is currently (21/3/91) used to open a configuration or ``initial-guess'' file name.CON (e.g. GAUSSIAN.CON for th e case of a muon signal with Gaussian relaxation). I will provide fuller details of this at a later time elsewhere. One of these functions allows the inclusion of several ``signals'' into the theoretical form - these are the direct analogues of the gms abov e. Each signal (defined in another STRUCTURE) now has four types of parameters, those which are global to all histograms and may be shared with another signal (e.g. magnetic field in a two-muon fit such as TRIUMF's MOLIONFCN molecular-ion function), those which are global but not shareable (e.g. relaxation parameters), those which differ for each histogram, like amplitudes am, and those which differ for each histogram but may be s hared with another signal, such as phases fm in a LF experiment. The normalisations and background for each histogram are also separate parameters. To date, I haven't thought up a sensible way of creating an initial-guess file for this compound function, since the signals may be combined in any arbitrary way.
Each signal FCN routine needs only to know about its own
parameters, and in fact I maintain arrays in virtual memory of the signals
amgm(t) and, where necessary, the partial derivatives a
|