Quadratic fits

+------------------------------------------------------------------------------+
|CALL  HQUAD (ID,CHOPT,MODE,SENSIT,SMOOTH,NSIG*,CHISQ*,NDF*,FMIN*,FMAX*, IERR*) |
+------------------------------------------------------------------------------+
                                  

[sec:HQUAD]

Action: This routine fits multiquadric radial basis functions to the bin contents of a histogram or the event density of an Ntuple. (For Ntuples this is currently limited to ``simple'' ones, i.e., with 1, 2 or 3 variables; all events are used -- no selection mechanism is implemented. Thus the recommended practice at the moment is to create a ``simple'' Ntuple and fill it from your ``master'' Ntuple with the NTUPLE/LOOP command and an appropriate SELECT.FOR function.) Routine HQUAD is called automatically in PAW by the existing command SMOOTH.

Input parameters:
ID
Histogram or Ntuple ID.
CHOPT
Character variable containing option characters:
0
Replace original histogram by smoothed.
2
Do not replace original histogram but store values of smoothed function and its parameters. (The fitted function is regenerated from the values or the parameters with the FUNC option in HISTOGRAM/PLOT for histograms or with NTUPLE/DRAW for Ntuples.)
V
Verbose.
MODE
Mode of operation
0
Same as MODE = 3 (see below).
3
find significant points and perform unconstrained fit. If the histogram or Ntuple is unweighted perform a Poisson likelihood fit, otherwise a least squares fit (see MODE = 4).
4
force an unconstrained least squares fit in all cases. (This is a linear least squares problem and therefore the most efficient possible since it allows a single step calculation of the best fit and covariances. But note it assumes gaussian errors, even for low statistics, including the error on zero being 1.)
SENSIT
Sensitivity parameter. It controls the sensitivity to statistical fluctuations (see Remarks). SENSIT = 0. is equivalent to SENSIT = 1.
SMOOTH
Smoothness parameter. It controls the (radius of) curvature of the multiquadric basis functions. SMOOTH = 0. is equivalent to SMOOTH = 1.
Output parameters:
NSIG
no. of significant points or centres found, i.e., no. of basis functions used.
CHISQ
chi-squared (see Remarks).
NDF
no. of degrees of freedom.
FMIN
minimum function value.
FMAX
maximum function value.
IERR
error flag, 0 if all's OK. (Hopefully helpful error messages are printed where possible.)

Remarks:

  1. Empty bins are taken into account. (Poisson statistics are used for the unweighted case.) 2 2
  2. The multiquadric basis functions are sqrt(r +Delta ), where r is the radial distance from its ``centre'', and Delta is a scale parameter and also the curvature at the ``centre''. ``Centres'', also referred to as ``significant points'', are located at points where the 2nd differential or Laplacian of event density is statistically significant.
  3. The data must be statistically independent, i.e., events (weighted or unweighted) drawn randomly from a parent probability distribution or differential cross-section, e.g., you cannot further smooth a previously smoothed distribution.
  4. For histograms, the chi-squared (CHISQ) is that of the fit to the original histogram assuming gaussian errors on the original histogram even for low statistics, including the error on zero being 1. It is calculated like this even for a Poisson likelihood fit; in that case the maximum likelihood may not correspond to the minimum chi-squared, but CHISQ can still be used, with NDF (the no. of degrees of freedom), as a goodness-of-fit estimator. For Ntuples, an internally generated and temporary histogram is used to calculate CHISQ in the same way.
                              Example of fits
                                      

          SUBROUTINE HEXAM5
    *.==========>
    *.           OPERATIONS ON HISTOGRAMS AND FITTING
    *..=========> (R.Brun, modified by M.Goossens)
          COMMON/HFPAR/PAR(6)
          COMMON/HFGAUS/AG,BG,CG
          DOUBLE PRECISION AG,BG,CG
          DIMENSION X(100),Y(100)
          DIMENSION XF(4000,2),YF(4000),EY(4000),SIGPAR(6)
          DOUBLE PRECISION COV(6,6)
          EXTERNAL HFUNF,HFUNFV,HFUNGA
          CHARACTER*12 TITL1
          DATA TITL1/'TITLE OF ID1'/
    *.___________________________________________
    *
    *             GET hist 110 from data base
    *
          CALL HRGET(110,'hexam.dat',' ')
          CALL HRGET(210,'hexam.dat',' ')
    *
    *
          CALL HBOOK1(1,TITL1,100,0.,1.,0.)
          CALL HCOPY(1,2,'TITLE OF ID = 2')
    *
    *             Gets information from ID=110 and fills new IDs 1,2
    *
          CALL HUNPAK(110,X,'HIST',1)
          CALL UCOPY(X,Y,100)
          CALL VZERO(X(51),50)
          CALL HPAK(1,X)
          CALL HPHIST(1,'HIST',1)
          CALL VZERO(Y,50)
          CALL HPAK(2,Y)
          CALL HPHIST(2,'HIST',1)
    *
    *             adds 1 and 2. Identifier 3 is created and will contain
    *             result of addition
    *
          CALL HOPERA(1,'+',2,3,1.,1.)
          CALL HCOPY(3,4,' ')
    *
    *             Fits 3 with function HFUNF, similar to example 2 .
    *             Initializes parameters. Prints results of the last
    *             iteration.
    
    *             Superimpose result of fit to the histogram
    *             The result of this fit can be compared with the initial
    *             parameters of example 2
    *
          PAR(1) = 40.
          PAR(2) = 20.
          PAR(3) = 0.4
          PAR(4) = 0.6
          PAR(5) = 0.1
          PAR(6) = 0.1
    *
          CALL HFITH(3,HFUNF,'V',6,PAR(1),ST,PMI,PMA,SIGPAR,CHI2)
    *
          CALL HPHIST(3,'HIST',1)
    *
    *
    *            Fits a two-dimensional distribution (xf,yf) with HFITN
    *            initialize parameters. Prints results of the last
    *            iteration.
    *            Errors EY automatically computed as SQRT(yf)
    *
          NY=0
          DO 10 J=1,40
             DO 5 I=1,100
                CONT=HIJ (210,I,J)
                IF (CONT.EQ.0.) GOTO 5
                NY=NY+1
                YF(NY)=CONT
                EY(NY)=SQRT(CONT)
                CALL HIJXY (210,I,J,X1,X2)
                XF(NY,1)=X1+0.005
                XF(NY,2)=X2+0.0125
        5    CONTINUE
       10 CONTINUE
          PAR(1) = 3.
          PAR(2) = 1.
          PAR(3) = 0.3
          PAR(4) = 0.7
          PAR(5) = 0.07
          PAR(6) = 0.12
    *
          CALL HFITV (NY,NY,1,XF,YF,EY,HFUNFV,'V',6,PAR(1),ST,PMI,PMA,
         +            SIGPAR,CHI2)
    *       Get covariance matrix of last fit from Minuit.
    *       Minuit parameters on 4-byte machines are Double precision
          CALL MNEMAT(COV,6)
          WRITE(31,*) ' COVARIANCE MATRIX'
          WRITE(31,*) ' *****************'
          DO 20 I=1,6
            WRITE(31,'(6(D12.4,1X))') (COV(I,J),J=1,I)
       20 CONTINUE
    *
    *       Gaussian fit. Prints first and last iterations.
    
    *
          AG = 2.
          BG = 0.4
          CG = 0.1
          CALL HDELET (0)
          CALL HBFUN1 (1,' ',100,0.,1.,HFUNGA)
          CALL HBOOK1 (5,' ',100,0.,1.,1000.)
          DO 30 I=1,5000
             XR=HRNDM1 (1)
             CALL HFILL (5,XR,0.,1.)
       30 CONTINUE
    *
          PAR(1) = 200.
          PAR(2) = 0.4
          PAR(3) = 0.1
          CALL HFITHN(5,'G',' ',3,PAR(1),ST,PMI,PMA,SIGPAR,CHI2)
          CALL HPRINT (5)
          CALL HDELET (0)
    *
          END
    *
          FUNCTION HFUNF(X)
          COMMON/HFPAR/PAR(6)
          DOUBLE PRECISION A1,A2,C1,C2,XM1,XM2,XS1,XS2,X1,X2
    *       Force double precision calculation
          C1  = PAR(1)
          C2  = PAR(2)
          XM1 = PAR(3)
          XM2 = PAR(4)
          XS1 = PAR(5)
          XS2 = PAR(6)
    *
          A1=-0.5*((X-XM1)/XS1)**2
          A2=-0.5*((X-XM2)/XS2)**2
          IF(A1.LT.-20.)THEN
             X1=0.
          ELSEIF(A1.GT.20.)THEN
             X1=1.E5
          ELSE
             X1=C1*EXP(A1)
          ENDIF
          IF(A2.LT.-20.)THEN
             X2=0.
          ELSEIF(A2.GT.20.)THEN
             X2=1.E5
          ELSE
             X2=C2*EXP(A2)
          ENDIF
          HFUNF=X1+X2
          END
          FUNCTION HFUNFV (X)
          DIMENSION X(*)
    *         Compute function value for 2-dim point X
    
          HFUNFV = HFUNF(X(1)) + HFUNF(X(2))
          END
          FUNCTION HFUNGA (X)
          COMMON/HFGAUS/AG,BG,CG
          DOUBLE PRECISION AG,BG,CG
          HFUNGA=AG*EXP(-0.5*((X-BG)/CG)**2)
          END
    
                             Output Generated
                                      

     TITLE OF ID1
     HBOOK     ID =         1                                        DATE  18/05/92              NO =    14
          172                                    -
          168                                    I
          164                                    I
          160                                   -I
          156                                   II -
          152                                   II-I
          148                                   I  I-
          144                                 --I   I
          140                                 I     I-
          136                                 I      I
          132                                 I      I
          128                                 I      I-
          124                                -I       I
          120                               -I        I
          116                               I         I
          112                               I         I
          108                               I         I
          104                              -I         I-
          100                              I           I
           96                              I           I -
           92                              I           I-I
           88                             -I             I
           84                             I              I -
           80                             I              I I
           76                             I              I I
           72                             I              I I-
           68                             I              I-II
           64                             I                 I
           60                           - I                 I
           56                           I-I                 I
           52                           I                   I-
           48                          -I                    I-
           44                          I                      I
           40                          I                      I-
           36                          I                       I
           32                          I                       I    -
           28                         -I                       I- - I
           24                       --I                         I-I I
           20                      -I                             I I-
           16                      I                              I-II
    
           12                     -I                                 I
            8                 - --I                                  I
            4            -----I-I                                    I
     CHANNELS 100   0                                                                                                  1
               10   0        1         2         3         4         5         6         7         8         9         0
                1   1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
     CONTENTS 100                          1111111111111
               10                 112224658012445755432099687543222121
                1.       211246268181476068282127104785115522257716498
     LOW-EDGE   1.            111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999
     *10**  1   0   0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
     * ENTRIES =        100      * ALL CHANNELS = 0.2825E+04      * UNDERFLOW = 0.0000E+00      * OVERFLOW = 0.0000E+00
     * BIN WID = 0.1000E-01      * MEAN VALUE   = 0.3087E+00      * R . M . S = 0.7466E-01
    
     TITLE OF ID = 2
     HBOOK     ID =         2                                        DATE  18/05/92              NO =    15
           84                                                                               -
           82                                                                             - I
           80                                                                             I I
           78                                                                       -     I I  -
           76                                                                       I -   I I  I
           74                                                                       I-I  -I I  I
           72                                                                       I I  II I  I
           70                                                                       I I- II I  I -
           68                                                                       I  I II-I -I-I
           66                                                                    -  I  I-I  I-I  I
           64                                                                  - I  I            I-
           62                                                                  I-I  I             I
           60                                                                  I I -I             I
           58                                                                  I I I              I
           56                                                                  I I I              I
           54                                                                  I I-I              I -
           52                                                                - I                  I I
           50                                                                I-I                  I-I
           48                                                                I                      I
           46                                                                I                      I
           44                                                                I                      I   -
           42                                                               -I                      I-  I
           40                                                              -I                        I  I
           38                                                              I                         I  I
           36                                                              I                         I  I-
           34                                                              I                         I--II
           32                                                              I                             I
           30                                                             -I                             I
           28                                                         -   I                              I  -
           26                                                         I  -I                              I- I
           24                                                         I  I                                I I
           22                                                         I- I                                I I--
           20                                                         II I                                I-I I -
           18                                                         II-I                                    I I
           16                                                         I                                       I-I
           14                                                         I                                         I
           12                                                         I                                         I--
           10                                                         I                                           I
            8                                                         I                                           I - -
            6                                                         I                                           I-I-I
            4                                                         I                                               I-
            2                                                         I                                                I
     CHANNELS 100   0                                                                                                  1
               10   0        1         2         3         4         5         6         7         8         9         0
                1   1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
     CONTENTS  10                                                     221233455666557776678686676664543343222221111
    
                1.                                                    71850922032539736953183588893942434650812591167574
     LOW-EDGE   1.            111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999
     *10**  1   0   0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
     * ENTRIES =        100      * ALL CHANNELS = 0.2175E+04      * UNDERFLOW = 0.0000E+00      * OVERFLOW = 0.0000E+00
     * BIN WID = 0.1000E-01      * MEAN VALUE   = 0.7102E+00      * R . M . S = 0.1063E+00
    
      MINUIT RELEASE 90.10  INITIALIZED.   DIMENSIONS 100/ 50  EPSMAC=  0.89E-15
     **********
     **    1 **SET EPS  0.1000E-06
     **********
     FLOATING-POINT NUMBERS ASSUMED ACCURATE TO   0.100E-06
         **********************************************
         *                                            *
         * Function minimization by SUBROUTINE HFITH  *
         * Variable-metric method                     *
         * ID =          3  CHOPT = V                 *
         *                                            *
         **********************************************
     Convergence when estimated distance to minimum (EDM) .LT.  0.10E-03
     PARAMETER DEFINITIONS:
        NO.   NAME         VALUE      STEP SIZE      LIMITS
         1 'P1        '    40.000       12.000         no limits
         2 'P2        '    20.000       6.0000         no limits
         3 'P3        '   0.40000      0.12000         no limits
         4 'P4        '   0.60000      0.18000         no limits
         5 'P5        '   0.10000      0.30000E-01     no limits
         6 'P6        '   0.10000      0.30000E-01     no limits
     **********
     **    2 **SET PRINT  0.0000
     **********
     **********
     **    3 **MIGRAD   1160.       1.000
     **********
     MIGRAD MINIMIZATION HAS CONVERGED.
     MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
     FCN=   81.55959     FROM MIGRAD    STATUS=CONVERGED    391 CALLS      392 TOTAL
                         EDM=  0.21E-05    STRATEGY= 1      ERROR MATRIX ACCURATE
      EXT PARAMETER                                   STEP         FIRST
      NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE
       1      P1        154.37        3.8591       0.97447      -0.16735E-03
       2      P2        74.934        2.1210       0.51925       0.16237E-03
       3      P3       0.30351       0.15347E-02   0.76783E-03  -0.91430
       4      P4       0.70017       0.29587E-02   0.17713E-02   0.19339
       5      P5       0.69299E-01   0.12334E-02   0.28758E-03   0.39057
       6      P6       0.11985       0.27357E-02   0.62656E-03   0.52392
     CHISQUARE = 0.9164E+00  NPFIT =   95
    
     TITLE OF ID1
     HBOOK     ID =         3                                        DATE  18/05/92              NO =    16
          172                                    -
          168                                    I
          164                                    I
          160                                   -I
          156                                   I***
          152                                   *I-I
          148                                   I  I*
          144                                 -*I   I
          140                                 I     I*
          136                                 *      I
          132                                 I      I*
          128                                 I      I-
          124                                *I       I
          120                               -I        I*
          116                               I         I
          112                               *         I
          108                               I         I *
          104                              -I         I-
          100                              I           I
           96                              *           I *
           92                              I           I-I
           88                             -I             I
           84                             *              I -                              - -
           80                             I              I*I                        -     I I  -
           76                             I              I I                        I--******  I
           72                            *I              I I-                       I**- II I**I -
           68                             I              I-*I                    - **  I-II-I--**I
           64                             I                 I                  --I* I            *-
           60                           * I                 *                  I * -I             *
           56                           I-I                 I                  I*I-I              I*-
           52                           I                   I-               --*                  I-*
           48                          *I                    *-              I*                     I*
           44                          I                      I             -*                      I-* -
           40                          I                      *-           **                        I **
           36                         *I                       I          *I                         I--I*
           32                          I                       *    -    *-I                             I*
           28                        *-I                       I* - I -**-I                              I-*-
           24                       *-I                         I***I**- I                                I *--
           20                      -I                             I *-II-I                                I-I** -
           16                      *                              I-I                                         I**
           12                    **I                                                                            I**
            8                 - *-I                                                                               I****
            4       ************I                                                                                     I*
     CHANNELS 100   0                                                                                                  1
               10   0        1         2         3         4         5         6         7         8         9         0
                1   1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
    
     CONTENTS 100                          1111111111111
               10                 112224658012445755432099687543222121221233455666557776678686676664543343222221111
                1.       21124626818147606828212710478511552225771649871850922032539736953183588893942434650812591167574
     LOW-EDGE   1.            111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999
     *10**  1   0   0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
     * ENTRIES =        200      * ALL CHANNELS = 0.5000E+04      * UNDERFLOW = 0.0000E+00      * OVERFLOW = 0.0000E+00
     * BIN WID = 0.1000E-01      * MEAN VALUE   = 0.4834E+00      * R . M . S = 0.2184E+00
     * CHISQUAR  =  0.8156E+02
    
         **********************************************
         *                                            *
         * Function minimization by SUBROUTINE HFITV  *
         * Variable-metric method                     *
         * ID =          0  CHOPT = V                 *
         *                                            *
         **********************************************
     Convergence when estimated distance to minimum (EDM) .LT.  0.10E-03
     PARAMETER DEFINITIONS:
        NO.   NAME         VALUE      STEP SIZE      LIMITS
         1 'P1        '    3.0000      0.90000         no limits
         2 'P2        '    1.0000      0.30000         no limits
         3 'P3        '   0.30000      0.90000E-01     no limits
         4 'P4        '   0.70000      0.21000         no limits
         5 'P5        '   0.70000E-01  0.21000E-01     no limits
         6 'P6        '   0.12000      0.36000E-01     no limits
     **********
     **    4 **SET PRINT  0.0000
     **********
     **********
     **    5 **MIGRAD   1160.       1.000
     **********
     MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
     MIGRAD MINIMIZATION HAS CONVERGED.
     MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
     EIGENVALUES OF SECOND-DERIVATIVE MATRIX:
            -0.1596E+01 -0.6458E+00  0.3800E+00  0.7478E+00  0.1277E+01  0.5837E+01
     MINUIT WARNING IN HESSE
     ============== MATRIX FORCED POS-DEF BY ADDING   1.6018     TO DIAGONAL.
     MIGRAD TERMINATED WITHOUT CONVERGENCE.
     FCN=   1709.709     FROM MIGRAD    STATUS=FAILED       197 CALLS      198 TOTAL
                         EDM=  0.41E+02    STRATEGY= 1      ERR MATRIX NOT POS-DEF
      EXT PARAMETER                APPROXIMATE        STEP         FIRST
      NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE
       1      P1        2.4709       0.73263E-01   0.00000        4.1109
       2      P2        1.8247       0.37237E-01   0.00000        8.5400
       3      P3       0.27725       0.24789E-02   0.00000       -125.59
       4      P4       0.70933       0.51778E-02   0.00000        132.72
       5      P5       0.90472E-01   0.47875E-02   0.00000       -302.38
       6      P6       0.21181       0.75383E-02   0.00000       -63.830
     CHISQUARE = 0.9282E+00  NPFIT = 1848
      COVARIANCE MATRIX
      *****************
      0.5367E-02
      0.9472E-03   0.1387E-02
    
      0.4548E-05  -0.9488E-06   0.6145E-05
     -0.1520E-04  -0.2581E-04   0.1647E-05   0.2681E-04
     -0.2597E-03  -0.7556E-04  -0.2361E-06   0.2208E-05   0.2292E-04
      0.1100E-03  -0.3230E-04  -0.1566E-05   0.1904E-05  -0.2129E-04   0.5683E-04
         **********************************************
         *                                            *
         * Function minimization by SUBROUTINE HFITH  *
         * Variable-metric method                     *
         * ID =          5  CHOPT =                   *
         *                                            *
         **********************************************
     Convergence when estimated distance to minimum (EDM) .LT.  0.10E-03
     FCN=   69.87250     FROM MIGRAD    STATUS=CONVERGED     64 CALLS       65 TOTAL
                         EDM=  0.38E-05    STRATEGY= 1      ERROR MATRIX ACCURATE
      EXT PARAMETER                                   STEP         FIRST
      NO.   NAME        VALUE          ERROR          SIZE      DERIVATIVE
       1      P1        199.30        3.5192       0.84934      -0.13509E-03
       2      P2       0.39761       0.14150E-02   0.10059E-02   -1.6362
       3      P3       0.98783E-01   0.10313E-02   0.24990E-03   -1.7442
     CHISQUARE = 0.1075E+01  NPFIT =   68
     EXAMPLE NO = 5
     --------------
     HBOOK     ID =         5                                        DATE  18/05/92              NO =    17
          230                                               -
          220                                            -  I
          210                                            I  I
          200                                            ****** -
          190                                          **I  I--*I-
          180                                         *I I    I *I
          170                                        * I-I    I-I*
          160                                       *I-I         I*
          150                                      *I             I*
          140                                      -I              I*
          130                                    -*I               I *--
          120                                    *-I               I--*I
          110                                   *I                     I
          100                                  *I                      *-
           90                                 *I                        *
           80                                *I                         I*
           70                               *I                          I-*
           60                              *-I                           I *--
    
           50                             *-I                            I-I*I
           40                           -*I                                  **-
           30                         -**                                    I-**
           20                       ***                                        I-***
           10       ****************I                                              I************************************
     CHANNELS 100   0                                                                                                  1
               10   0        1         2         3         4         5         6         7         8         9         0
                1   1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
     CONTENTS 100                               111111111211211121111111
               10                 1 112233456889131356586199288608541122964655231111
                1.    1    2224268062313614000760053587389243868095597245890427768955738341  11        1
     LOW-EDGE   1.            111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999
     *10**  1   0   0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
     * ENTRIES =       5000      * ALL CHANNELS = 0.5000E+04      * UNDERFLOW = 0.0000E+00      * OVERFLOW = 0.0000E+00
     * BIN WID = 0.1000E-01      * MEAN VALUE   = 0.3984E+00      * R . M . S = 0.9985E-01
     * CHISQUAR  =  0.6987E+02
    
                 Example of parametrization and smoothing
                                      

          SUBROUTINE HEXAM6
    *.==========>
    *.           PARAMETRIZATION      -     SMOOTHING
    *..=========> ( R.Brun )
          DOUBLE PRECISION COEFF
          DIMENSION ITERM(15),COEFF(15)
    *.___________________________________________
    *
    *             Get hist 110 from data base
    *
          CALL HRGET(110,'hexam.dat',' ')
    *
    *       Find best parametrization of histogram in terms of powers
    *       of shifted Tchebychev polynomials
    *       also produces the corresponding fortran function (here on
    *       standard output)
    *
    *
          CALL HCOPY(110,1,' ')
          CALL HSETPR('PNBX',15.)
          CALL HSETPR('PNCX',15.)
          CALL HSETPR('PLUN',31.)
          CALL HPARAM(1,3011,1.,14,COEFF,ITERM,NCO)
          CALL HPRINT(1)
    *
    *        ID=2 is smoothed with B-splines
    *        statistical errors (sqrt of contents) are drawn
    *
          CALL HCOPY(110,2,' ')
          CALL HSPLI1(2,2,14,3,CHI2)
          CALL HIDOPT(2,'ERRO')
          CALL HPHIST(2,'HIST',1)
          END
    
                             Output Generated
                                      

     ****************************************
     *                                      *
     *   MULTIDIMENSIONAL PARAMETRIZATION   *
     *                                      *
     ****************************************
     FIT CHARACTERISTICS AND OPTIONS
     *******************************
     ID =   1
     DIM =  1
     WORKING SPACE IN /PAWC/ =    5045
      0 USER-DEFINED BASIC FUNCTIONS
      0 USER-DEFINED ELEMENTARY FUNCTIONS
     MAX NUMBER OF REGRESSORS = 15
     MAX POWERS OF POLYNOMIALS IN  EACH DIM = 14
     AMOUNT OF OUTPUT = 1
     WEIGHTING TYPE = 0
     CLASS OF POLYNOMIALS = 3
     CLASS OF BASIC FUNCTIONS = 0
     BASIC FUNCTION SELECTION MODE = 0
     REGRESSION MODE = 0
     X-NORMALIZATION TYPE = 0
     POWER LIMITOR =  1.00
     F-TEST LEVEL =   1.00
     PARAMETRIZATION SUPERIMPOSED ON HISTOGRAM
     FORTRAN CODE FPARAM WRITTEN ON UNIT 31
     FITTING PROCESS WILL STOP WHEN THE RESIDUAL VARIANCE HITS A MINIMUM
      15 CANDIDATE BASIC FUNCTIONS WERE RETAINED FOR THE FIT
     NUMBER OF POINTS TO FIT =    95
     SUM OF SQUARES OF Y-VALUES =   5000.0
     MACHINE PRECISION =  0.22E-15
     FITTING PROCESS STOPPED AS RESIDUAL VARIANCE HITS MINIMUM
     R2 =  0.98543      12 REGRESSORS INCLUDED
     FINAL RESULTS OF THE FIT
     ************************
    
     ITERATION       RSS       R2ADJ     REGRESSOR  COEFF. VALUE   TERM OF PARAMETRIZATION
        13        72.841       0.98350       1        40.320         0
                                             2       -32.156        20
                                             3        29.461        60
                                             4       -20.018        80
                                             5        7.7912       100
                                             6       -18.482        50
                                             7       -7.0469       110
                                             8       -9.0691        10
                                             9        4.4675       130
                                            10        6.4382        90
                                            11       -3.9874       140
                                            12        3.1189        30
     REGRESSOR  STANDARD DEVIATION     CONFIDENCE INTERVAL
         1          0.70650         [  39.144    ,  41.495    ]
         2           1.0509         [ -33.904    , -30.407    ]
         3          0.85147         [  28.044    ,  30.877    ]
         4          0.90853         [ -21.530    , -18.506    ]
         5          0.82336         [  6.4213    ,  9.1611    ]
         6           1.0259         [ -20.189    , -16.775    ]
         7          0.78401         [ -8.3514    , -5.7425    ]
         8           1.0731         [ -10.854    , -7.2836    ]
         9          0.68036         [  3.3355    ,  5.5995    ]
        10          0.83660         [  5.0463    ,  7.8301    ]
        11          0.85716         [ -5.4135    , -2.5612    ]
        12           1.1372         [  1.2267    ,  5.0110    ]
          DOUBLE PRECISION FUNCTION FPARAM (X)
          DOUBLE PRECISION COEFF,P,P0,P1,P2,HELEFT,HBASFT
          DIMENSION X(1),COEFF(12),IBASFT( 1,12)
          DATA COEFF/ 0.40319615E+02,-0.32155589E+02, 0.29460772E+02,
         +-0.20017895E+02, 0.77912196E+01,-0.18481896E+02,
         +-0.70469122E+01,-0.90690550E+01, 0.44674803E+01,
         + 0.64381900E+01,-0.39873663E+01, 0.31188760E+01
         +/
          DATA IBASFT/  0, 20, 60, 80,100, 50,110, 10,130, 90,140, 30
         +/
          FPARAM=0.
          DO 25 K=1,12
          P=1.
          DO 15 I=1, 1
          NUM=IBASFT(I,K)/10
          ITYP=IBASFT(I,K)-NUM*10
          IF (NUM.NE.0) THEN
          IF (ITYP.EQ.0) THEN
          P0=1.
          P1=2*X (I)-1.
          DO 10 J=2,NUM
          P2=2*(2*X (I)-1.)*P1-P0
          P0=P1
       10 P1=P2
          P=P*P1
    
          END IF
          IF (ITYP.EQ.1) P=P*HELEFT(NUM,X (I))
          IF (ITYP.EQ.2) THEN
          P=HBASFT(NUM,X )
          GOTO 20
          END IF
          END IF
       15 CONTINUE
       20 FPARAM=FPARAM+COEFF(K)*P
       25 CONTINUE
          RETURN
          END
    
     THIS HISTOGRAM IS FILLED ACCORDING TO THE FUNCTION HTFUN1
     HBOOK     ID =         1                                        DATE  17/12/91              NO =  18
          172                                    -
          168                                    I
          164                                    I
          160                                   -I
          156                                   II -
          152                                   I**I
          148                                   *  *-
          144                                 -*I   *
          140                                 I     I-
          136                                 *      *
          132                                 I      I
          128                                *I      I*
          124                                -I       I
          120                               -I        I*
          116                               *         I
          112                               I         I
          108                               I         I *
          104                              -I         I-
          100                              *           I
           96                              I           I *
           92                              I           I-I
           88                             *I             I
           84                             I              I*-                              - -
           80                             I              I I                        -     I I  -
           76                            *I              I I                        I-******** I
           72                             I              I *-                       **I- II I *I -
           68                             I              I-II                    - *I  I-II-I--**I
           64                             I                 I                  --I* I            *-
           60                           * I                 *                  I** -I             *
           56                           I-I                 I                  * I-I              I*-
           52                           I                   I*               -*I                  I-*
           48                          *I                    I-              *                      I*
           44       *                  I                      *             *I                      I-* -
           40                          I                      I-           *I                        I *I
           36        *                *I                       *          *I                         I--*-
           32                          I                       I    -    *-I                             **
           28                        *-I                       I* - I - *-I                              I-*-
           24         *             --I                         I*I I ** I                                I **-
           20                      -*                             ****II-I                                I-I **-
           16          *           *                              I-I                                         I-**
           12                     *I                                                                            I-*
            8           *     -***I                                                                               I****
            4            ******-I                                                                                     I*
     CHANNELS 100   0                                                                                                  1
               10   0        1         2         3         4         5         6         7         8         9         0
                1   1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
     CONTENTS 100                          1111111111111
    
               10                 112224658012445755432099687543222121221233455666557776678686676664543343222221111
                1.       21124626818147606828212710478511552225771649871850922032539736953183588893942434650812591167574
     LOW-EDGE   1.            111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999
     *10**  1   0   0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
     * ENTRIES =       5000      * ALL CHANNELS = 0.5000E+04      * UNDERFLOW = 0.0000E+00      * OVERFLOW = 0.0000E+00
     * BIN WID = 0.1000E-01      * MEAN VALUE   = 0.4834E+00      * R . M . S = 0.2184E+00
     * CHISQUAR  =  0.7284E+02
    
     THIS HISTOGRAM IS FILLED ACCORDING TO THE FUNCTION HTFUN1
     HBOOK     ID =         2                                        DATE  17/12/91              NO =  19
          185                                    I
          180                                    I
          175                                    0
          170                                   II I
          165                                   IIII
          160                                   0IIII
          155                                 III I0I
          150                                 III**I0I
          145                                 00* I*II
          140                                 I*  I *0I
          135                                I*I    III
          130                               III      *I
          125                               I*        *
          120                               0I        I
          115                              I*I        I*
          110                              II          I
          105                              0           0*I
          100                             I*           III
           95                             II           I0* I                                I
           90                             *             II I                        I     I I  I
           85                             I             I *0I                       III  I0 0  I
           80                            *I                II                       0I0I***II I0II
           75                                             I*0                  I I  ****I0I***IIIII
           70                           *                 I I                  III**III0II 0 I**00I
           65                           II                0 *                  00*II I I0I I 0I **0 I
           60                           00                I  *               III*II0    I  I II I *II
           55                          *II                   0I              0I*I 0I               **   I
           50                          0 I                   I*            III*   I                0I*  I
           45                         *I                     I0*           I**I                    I 0* 0I
           40                          I                      I0          I*I                        II**0
           35                        *I                        I* I I I   *I                          00 *  I
           30                       II0                         0** 0 0I**0                           II I**0II
           25                      I*0I                         I0I*****I0I                               0I**0 I
           20                      *II                           I I 0 I0I                                I0 I**0
           15                    I*I                               0 I  I                                      0**0
           10                I0 0*I                                                                              I****0I
            5            ********                                                                                  II0**
     CHANNELS 100   0                                                                                                  1
               10   0        1         2         3         4         5         6         7         8         9         0
                1   1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
     CONTENTS 100                          1111111111111
               10                 112224658012445755432099687543222121221233455666557776678686676664543343222221111
                1.       21124626818147606828212710478511552225771649871850922032539736953183588893942434650812591167574
     LOW-EDGE   1.            111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999
     *10**  1   0   0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
    
     * ENTRIES =       5000      * ALL CHANNELS = 0.5000E+04      * UNDERFLOW = 0.0000E+00      * OVERFLOW = 0.0000E+00
     * BIN WID = 0.1000E-01      * MEAN VALUE   = 0.4834E+00      * R . M . S = 0.2184E+00
     * CHISQUAR  =  0.9674E+02