[HSMOOTH]
Histograming is the least expensive and most popular density estimator,
but has several statistical drawbacks. To name only two, it fails to
identify structures that are much narrower than the bin size, and exhibits
sharp discontinuities (statistical fluctuations) among adjacent low
population bins.
The first problem is usually solved by adapting the bin width to the
experimental resolution, or by re-binning after looking at the histogram.
To filter out the statistical fluctuations, smoothing algorithms can be
applied.
Two such techniques are implemented in HBOOK, the so called 353QH
( HSMOOF) and the method of B-splines ( HSPLI1, HSPLI2, HSPFUN). Before
trying them out references
[bib-DATA], [bib-SPLINE] and [bib-LISS]
should be consulted, and results taken with care.
+------------------------------+
| CALL HSMOOF (ID,ICASE,CHI2*) |
+------------------------------+
Action: This rouitne smoothes a 1-dimensional histogram according to the
algorithm 353QH, TWICE (see [bib-DATA]).
- Input parameters:
-
- ID
- Histogram identifier
- ICASE
- 0 and 1 replace original histogram by smoothed
2 superimpose as a function when editing
- Output Parameter:
-
2
- CHI2
- chisquare chi between original and smoothed
histogram.
Remark:
- The mean value and standard deviation are recalculated if
ICASE=1
- The routine can be called several times for the same histogram
identifier ID, for ICASE=1 or 2.
+------------------------------+
|CALL HSPLI1 (ID,IC,N,K,CHI2*) |
+------------------------------+
Action: B-splines smoothing of a 1-dimensional histogram.
- Input parameters:
-
- ID
- Identifier of an existing 1-dimensional histogram
- IC
- Superimposition flag (IC=0 is identical
to IC=1)
1 Replace original contents by the value of the spline
2 Superimpose the spline function when editing
- N
- Number of knots (when N<=0 then
N=13).
- K
- Degree of the splines (when
K>=3 then K=3).
- Output Parameter:
-
2
- CHI2
- chisquare chi between original and smoothed
histogram.
Remark:
- HSPLI1 can be called several times for the same histogram identifier
ID, for any value of the parameters
- If the distribution to be smoothed exibits NP statistically
relevant peaks then a rule of thumb to define the number of knots is,
N = 4*NP+6 for a spline of degree 3.
+------------------------------+
| CALL HSPLI2 (ID,NX,NY,KX,KY) |
+------------------------------+
Action: B-splines smoothing of a 2-dimensional histogram.
- Input parameters:
-
- ID
- Identifier of an existing 2-dimensional
- NX
- Number of knots in the X interval (when
NX<=0 then NX=13).
- NY
- Number of knots in the Y interval (when
NY<=0 then NY=13).
- KX
- Degree of the spline in X (when
KX>=3 then KX=3).
- KY
- Degree of the spline in Y (when
KY>=3 then KY=3).
Remark:
- The original contents of the histogram are replaced by the value of
the spline approximation.
- See the remark about the number of knots for routine HSPLI1.
+----------------------+
|S = HSPFUN (ID,X,N,K) |
+----------------------+
Action: Performs a B-spline smoothing of a 1-dimensional histogram and
returns the value at a given abscissa point.
- Input parameters:
-
- ID
- Identifier of an existing 1-dimensional histogram
- X
- Abscissa
- N
- Number of knots (when N<=0 then
N=13).
- K
- Degree of the splines (when
K>=3 then K=3).