next up previous contents index
Next: When to use Up: Operations on Histograms Previous: Statistical Considerations

Bin by bin histogram comparisons

CALL HDIFFB (ID1,ID2,TOL,NBINS,CHOPT,NBAD*,DIFFS*)

Action: Compare two histograms, bin by bin. For each bin, return the probability that the contents are from the same distribution. For details of the method see below.

The comparison may be done between two 1-dimensional histograms, two 2-dimensional histograms, or between two profile histograms.

Input parameters:
ID1
The first histogram to be compared. The ``reference'' histogram in options A and C.
ID2
The second histogram to be compared. The ``data'' histogram in options A and C.
ID1, ID2 are a pair of 1-D, 2-D, or profile histograms booked with the same number of bins.
TOL
The tolerance for a passing the test. Under options S and C, TOL is a number between 0 and 1 which represents the smallest probability considered as an acceptable match. TOL=0.05 will cause DIFFS to reject the bin as bad if there is less than a 5% probability the two bins came from the same distribution. Under option A, TOL is the degree of precision of match required for the test to be considered as passed. TOL=2.0 means that a data bin differing from the reference mean by less than 2.0 times the reference error is compatible.
NBINS
The number of bins in the comparison. For a 1-dimensional histogram, this is the number of bins plus 0, 1 or 2, depending on whether the overflow and underflow channels are included. For a 2-dimensional histogram, this will have the total number of bins plus room for overflow bins along any of the axes requested. For more detail, see the discussion of DIFFS below.
CHOPT
A string allowing specification of the following options:
N
Use the absolute contents of each histogram, thus including the normalization of the histogram as well as its shape in the comparison. By default, for the S and C options, in 1- and 2-dimensional histograms, the means are adjusted for the relative numbers of entries (including any overflow or underflow bins requested) in ID1 and ID2. No adjustment is ever made for profile histograms.
O
Overflow, requests that overflow bins be taken into account.
U
Underflow, requests that underflow bins be taken into account.
R
Right overflow bin. For a 2-dimensional histogram, it includes the X-Axis overflow bin in the comparisons. If the O option is used, this is automatic.
L
Left underflow bin. Same as above, but the X-Axis underflow is used. The U option uses this automatically.
T
Top overflow bin. Same as R, but for the Y-Axis.
B
Bottom underflow bin. Option L for the Y-Axis.
S
Statistical comparison. Calculates the probability that both bins were produced from a distribution with the same mean. This probability is referred to in TOL and DIFFS.
C
Compatibility test. Considers bins of the reference histogram (ID1) as perfectly describing the true distribution. Calculates the probability that the data (from ID2) was produced from that distribution. For 1- or 2-dimensional histograms, the Poisson mean is deduced from ID1. For profile histograms, the test assumes a Gaussian with mean and standard deviation given by the ID1. The C option should be used when comparing data to a function, a well-known reference, or a calibration distribution.
A
Absolute test. Like the C test, except that TOL and DIFFS are in terms of the number of standard deviations, rather probability. The test is on the number of standard deviations by which the data from ID2 deviates from the mean. Both the mean and the standard deviation are deduced from ID1. Error bars must be on for this option. This forbids overflow bins, underflow bins, and 2-dimensional histograms. The A option ignores bins with zero contents in reference histogram.
Z
Ignores bins with zero contents in the comparison. For the S option, ignores bins with zero contents in either histogram. For the C and A option, ignores bins with zero contents in the reference histogram. The default action is to consider all bins as significant.
D
Debug printout, dumps the critical variables in the comparisons, along with indicators of its weight, etc. The default (no options selected) does the S option (statistical comparison), ignores underflow and overflow bins, and automatically corrects for the difference in entries between ID1 and ID2.
Output parameters:
NBAD*
The number of bins failing the compatibility test according to the criteria defined by TOL and CHOPT.
DIFFS*
An array of length the number of bins being compared, which gives the results of the test bin by bin (confidence levels for options S and C, deviations for option A). Results are passed back in the form:
1-D
DIFFS(NX) for no over or underflow or DIFFS(0:NX+1), for overflow and/or underflow.
2-D
DIFFS(NX,NY) or DIFFS(0:NX+1, 0:NY+1).


next up previous contents index
Next: When to use Up: Operations on Histograms Previous: Statistical Considerations

Last update: Tue May 16 09:09:27 METDST 1995