Glen Cowan 1 December, 1999 Sample MINUIT session with the program FITTER This file contains the output from a session with the interactive version of MINUIT, implemented in a sample program called fitter. The commands that are entered by the user are indicated by arrows <---------- like this. More information on all of the MINUIT commands can be found in the minuit manual; both PS and HTML versions are available from http://consult.cern.ch/writeup/minuit/ In addition, you can type help at the MINUIT prompt when running the program. In order to use the interactive version, you should have a file that describes your parameters and assigns initial values. A sample file is given in ls_fit.min. The file must have the suffix .min, and IT MUST END WITH A BLANK LINE. The program is set up to fit a polynomial, and the parameter file is set up to define 10 parameters, i.e. a 9th order polynomial. In order to fit a different function, you need to change the subroutine FCN. In particular, you change the double precision function f, which is called from FCN, and is in the same file (fcn.f) at the end. In the example below, several of the parameters are fixed with the "fix" command. They can later be made adjustable again with the "rel" command. They can also be set to specific values with the "set par" command. Notice that in these commands, the parameters are referred to by their numbers, not their names. The session below generated a ps file fitter_plot.ps as output showing the fit result. This is done by entering "call 3". This forces the program to call the subroutine FCN with iflag=3, which in turn calls routines to make the plot (see fcn.f). In addition, plots of chi2 vs parameter values can be made with the scan and contour commands, but these are only made with text characters (see below). ./fitter.lnk <-------------------------- link the program ./fitter <-------------------------- run the program Version 1.23/09 of HIGZ started *************************************************************************** MINUIT RELEASE 96.03 INITIALIZED. DIMENSIONS 100/ 50 EPSMAC= 0.89E-15 *************************************************************************** MINUIT DATA BLOCK NO. 1 *************************************************************************** ENTER MINUIT TITLE, or "SET INPUT n" : set input 1 ls_fit.min <------------ read in the parameter file ********** ** 1 **set input 1 ls_fit.min ********** UNIT NO. :1 FILE NAME IS:ls_fit.min UNIT 1 IS NOT OPENED. FILE OPENED SUCCESSFULLY. SHOULD UNIT 1 BE REWOUND? <----------- accept with a carriage return polynomial fit ****************************************************************************** PARAMETER DEFINITIONS: NO. NAME VALUE STEP SIZE LIMITS 1 'c0 ' 0.00000E+00 1.0000 no limits 2 'c1 ' 0.00000E+00 1.0000 no limits 3 'c2 ' 0.00000E+00 1.0000 no limits 4 'c3 ' 0.00000E+00 1.0000 no limits 5 'c4 ' 0.00000E+00 1.0000 no limits 6 'c5 ' 0.00000E+00 1.0000 no limits 7 'c6 ' 0.00000E+00 1.0000 no limits 8 'c7 ' 0.00000E+00 1.0000 no limits 9 'c8 ' 0.00000E+00 1.0000 no limits 10 'c9 ' 0.00000E+00 1.0000 no limits *************************************************************************** MINUIT: FIRST CALL TO USER FUNCTION, WITH IFLAG=1 enter file name for input data (=ls_data.dat) ls_data.dat <--- data file FCN= 3215.025 FROM PARAMETR STATUS=RESET 2 CALLS 2 TOTAL EDM= unknown STRATEGY= 1 NO ERROR MATRIX EXT PARAMETER CURRENT GUESS PHYSICAL LIMITS NO. NAME VALUE ERROR NEGATIVE POSITIVE 1 c0 0.00000E+00 1.0000 2 c1 0.00000E+00 1.0000 3 c2 0.00000E+00 1.0000 4 c3 0.00000E+00 1.0000 5 c4 0.00000E+00 1.0000 6 c5 0.00000E+00 1.0000 7 c6 0.00000E+00 1.0000 8 c7 0.00000E+00 1.0000 9 c8 0.00000E+00 1.0000 10 c9 0.00000E+00 1.0000 END OF DATA ON UNIT NO. 1 INPUT WILL NOW BE READ IN INTERACTIVE MODE FROM UNIT NO. 5 FILENAME: /dev/ttyq2 ENTER MINUIT COMMAND: fix 10 <------------- fix parameter number 10 (i.e. c9) ********** ** 2 **FIX 10.00 ********** ENTER MINUIT COMMAND: fix 9 <------------- fix parameter number 9 ********** ** 3 **FIX 9.000 ********** ENTER MINUIT COMMAND: fix 8 <------------- fix parameter number 8 ********** ** 4 **FIX 8.000 ********** ENTER MINUIT COMMAND: fix 7 <------------- fix parameter number 7 ********** ** 5 **FIX 7.000 ********** ENTER MINUIT COMMAND: fix 6 <------------- fix parameter number 6 ********** ** 6 **FIX 6.000 ********** ENTER MINUIT COMMAND: sim <------------- minimize with the simplex algorithm ********** ** 7 **SIM ********** START SIMPLEX MINIMIZATION. CONVERGENCE WHEN EDM .LT. 0.10E+00 FCN= 555.9934 FROM SIMPLEX STATUS=PROGRESS 15 CALLS 17 TOTAL EDM= 0.21E+10 STRATEGY= 1 NO ERROR MATRIX EXT PARAMETER CURRENT GUESS PHYSICAL LIMITS NO. NAME VALUE ERROR NEGATIVE POSITIVE 1 c0 13.000 1.0000 2 c1 0.00000E+00 1.0000 3 c2 0.00000E+00 1.0000 4 c3 0.00000E+00 1.0000 5 c4 0.00000E+00 1.0000 6 c5 0.00000E+00 fixed 7 c6 0.00000E+00 fixed 8 c7 0.00000E+00 fixed 9 c8 0.00000E+00 fixed 10 c9 0.00000E+00 fixed SIMPLEX MINIMIZATION HAS CONVERGED. FCN= 64.49479 FROM SIMPLEX STATUS=PROGRESS 203 CALLS 205 TOTAL EDM= 0.60E-01 STRATEGY= 1 NO ERROR MATRIX EXT PARAMETER CURRENT GUESS PHYSICAL LIMITS NO. NAME VALUE ERROR NEGATIVE POSITIVE 1 c0 0.31974 1.0000 2 c1 3.5602 1.0000 3 c2 0.29110E-01 1.0000 4 c3 -0.27472E-01 1.0000 5 c4 0.92691E-03 1.0000 6 c5 0.00000E+00 fixed 7 c6 0.00000E+00 fixed 8 c7 0.00000E+00 fixed 9 c8 0.00000E+00 fixed 10 c9 0.00000E+00 fixed ENTER MINUIT COMMAND: mig <---------- minimize with MIGRAD ********** ** 8 **MIG ********** START MIGRAD MINIMIZATION. STRATEGY 1. CONVERGENCE WHEN EDM .LT. 0.10E-03 FCN= 64.49479 FROM MIGRAD STATUS=INITIATE 20 CALLS 225 TOTAL EDM= unknown STRATEGY= 1 NO ERROR MATRIX EXT PARAMETER CURRENT GUESS STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 c0 0.31974 1.0000 0.16589 0.46727 2 c1 3.5602 1.0000 0.47838E-01 5.0985 3 c2 0.29110E-01 1.0000 0.53033E-03 -7.7307 4 c3 -0.27472E-01 1.0000 0.47078E-03 113.83 5 c4 0.92691E-03 1.0000 0.19185E-04 -7138.8 6 c5 0.00000E+00 fixed 7 c6 0.00000E+00 fixed 8 c7 0.00000E+00 fixed 9 c8 0.00000E+00 fixed 10 c9 0.00000E+00 fixed MIGRAD MINIMIZATION HAS CONVERGED. MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX. COVARIANCE MATRIX CALCULATED SUCCESSFULLY FCN= 45.50617 FROM MIGRAD STATUS=CONVERGED 144 CALLS 349 TOTAL EDM= 0.13E-13 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 c0 4.5047 1.1388 0.74996E-03 0.27499E-07 2 c1 -0.54278E-01 0.85422 0.65221E-04 0.27154E-06 3 c2 0.78713 0.17407 0.39124E-05 0.47265E-05 4 c3 -0.82833E-01 0.12866E-01 0.22219E-06 0.64359E-04 5 c4 0.22356E-02 0.31143E-03 0.12292E-07 0.11735E-02 6 c5 0.00000E+00 fixed 7 c6 0.00000E+00 fixed 8 c7 0.00000E+00 fixed 9 c8 0.00000E+00 fixed 10 c9 0.00000E+00 fixed EXTERNAL ERROR MATRIX. NDIM= 50 NPAR= 5 ERR DEF= 1.00 0.130E+01-0.902E+00 0.167E+00-0.113E-01 0.253E-03 -0.902E+00 0.730E+00-0.144E+00 0.101E-01-0.233E-03 0.167E+00-0.144E+00 0.303E-01-0.221E-02 0.522E-04 -0.113E-01 0.101E-01-0.221E-02 0.166E-03-0.398E-05 0.253E-03-0.233E-03 0.522E-04-0.398E-05 0.970E-07 PARAMETER CORRELATION COEFFICIENTS NO. GLOBAL 1 2 3 4 5 1 0.98025 1.000-0.927 0.840-0.769 0.713 2 0.99974 -0.927 1.000-0.970 0.921-0.875 3 0.99998 0.840-0.970 1.000-0.987 0.962 4 0.99999 -0.769 0.921-0.987 1.000-0.993 5 0.99993 0.713-0.875 0.962-0.993 1.000 ENTER MINUIT COMMAND: hesse <------------- compute covariance matrix with HESSE ********** ** 9 **HESSE ********** COVARIANCE MATRIX CALCULATED SUCCESSFULLY FCN= 45.50617 FROM HESSE STATUS=OK 31 CALLS 380 TOTAL EDM= 0.23E-13 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER INTERNAL INTERNAL NO. NAME VALUE ERROR STEP SIZE VALUE 1 c0 4.5047 1.1409 0.14999E-03 4.5047 2 c1 -0.54278E-01 0.85653 0.13044E-04 -0.54278E-01 3 c2 0.78713 0.17462 0.78248E-06 0.78713 4 c3 -0.82833E-01 0.12909E-01 0.44438E-07 -0.82833E-01 5 c4 0.22356E-02 0.31245E-03 0.24583E-08 0.22356E-02 6 c5 0.00000E+00 fixed 7 c6 0.00000E+00 fixed 8 c7 0.00000E+00 fixed 9 c8 0.00000E+00 fixed 10 c9 0.00000E+00 fixed EXTERNAL ERROR MATRIX. NDIM= 50 NPAR= 5 ERR DEF= 1.00 0.130E+01-0.907E+00 0.168E+00-0.113E-01 0.254E-03 -0.907E+00 0.734E+00-0.145E+00 0.102E-01-0.234E-03 0.168E+00-0.145E+00 0.305E-01-0.223E-02 0.525E-04 -0.113E-01 0.102E-01-0.223E-02 0.167E-03-0.401E-05 0.254E-03-0.234E-03 0.525E-04-0.401E-05 0.976E-07 PARAMETER CORRELATION COEFFICIENTS NO. GLOBAL 1 2 3 4 5 1 0.98032 1.000-0.928 0.841-0.770 0.714 2 0.99974 -0.928 1.000-0.970 0.922-0.875 3 0.99998 0.841-0.970 1.000-0.987 0.962 4 0.99999 -0.770 0.922-0.987 1.000-0.993 5 0.99993 0.714-0.875 0.962-0.993 1.000 ENTER MINUIT COMMAND: call 3 <---------- make plot by calling FCN with iflag=3 ********** ** 10 **CALL 3.000 ********** store plot in ps file (0=no,1=yes) (=0) 1 PostScript file (=minuit_fit.ps) fitter_plot.ps enter x_min (=0) 0 enter x_max (=0) 22 enter y_min (=0) 0 enter y_max (=0) 35 enter x axis title x ENTER MINUIT COMMAND: scan 1 <---------- make plot of chi2 vs parameter number 1 ********** ** 11 **SCAN 1.000 ********** 0SCAN OF PARAMETER NO. 1, c0 75.00000 ...................................................... . * . . 73.00000 ... . *. . . . 71.00000 ... . . . . . 69.00000 ... * . * . . . . 67.00000 ... . . . . . 65.00000 ... * . * . . . . 63.00000 ... . . . . . 61.00000 ... * . * . . . . 59.00000 ... . . . * . . 57.00000 ... . * . . . . 55.00000 ... * . * . . . . 53.00000 ... . . . * . * . 51.00000 ... . . . * . * . 49.00000 ... . . . * . * . 47.00000 ... * . * . . * . * . 45.00000 ..........................*.&.*....................... 44.00000 ...................................................... / / / / / / 3.250 3.750 4.250 4.750 5.250 5.750 ONE COLUMN=0.5000000E-01 Overprint character is & FCN= 45.50617 FROM SCAn STATUS=NO CHANGE 25 CALLS 406 TOTAL EDM= 0.23E-13 STRATEGY= 1 ERROR MATRIX ACCURATE EXT PARAMETER STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 c0 4.5047 1.1409 0.14999E-03 0.27713E-07 2 c1 -0.54278E-01 0.85653 0.13044E-04 0.25329E-06 3 c2 0.78713 0.17462 0.78248E-06 0.45434E-05 4 c3 -0.82833E-01 0.12909E-01 0.44438E-07 0.60984E-04 5 c4 0.22356E-02 0.31245E-03 0.24583E-08 0.12731E-02 6 c5 0.00000E+00 fixed 7 c6 0.00000E+00 fixed 8 c7 0.00000E+00 fixed 9 c8 0.00000E+00 fixed 10 c9 0.00000E+00 fixed ENTER MINUIT COMMAND: con 1 2 <-------- make contour plot of chi2 for params 1 and 2 ********** ** 12 **CON 1.000 2.000 ********** Y-AXIS: PARAMETER 2: c1 1.584 * 1.435 * 1.286 * 1.137 * 0.9885 * 0.8395 * 0.6905 * 0.5416 * 0.3926 DDEEFFGGHHIJJ 0.2436 777888899AABCCDEEFGGHIJJ 0.9468E-01 76654433333345567889ABBCD -0.5428E-01 7665443333334333333445667 -0.2032 DCBBA98876554333333445667 -0.3522 JJIHGGFEEDCCBAA998888777 -0.5012 JJIHHGGFFEEDD -0.6501 * -0.7991 * -0.9480 * -1.097 * -1.246 * -1.395 * -1.544 * -1.693 * I I I 2.223 6.786 4.505 X-AXIS: PARAMETER 1: c0 ONE COLUMN= 0.1825 FUNCTION VALUES: F(I)= 45.51 + 1.000 *I**2 ENTER MINUIT COMMAND: exit <-------------- quit program ********** ** 13 **EXIT ********** ..........MINUIT TERMINATED BY MINUIT COMMAND: EXIT