The HISTOGRAM function returns a longword vector equal to the density function of Array . In the simplest case, the density function, at subscript i , is the number of Array elements in the argument with a value of i .
Let F i = the value of element i , 0 <= i < n . Let H v = result of histogram function, a longword vector. The definition of the histogram function becomes:
For bivariate probability distributions, use the HIST_2D function.
HISTOGRAM can optionally return an array containing a list of the original array subscripts that contributed to each histogram bin. This list, commonly called the reverse (or backwards) index list, efficiently determines which array elements are accumulated in a set of histogram bins. A typical application of the reverse index list is reverse histogram or scatter plot interrogation--a histogram bin or 2D scatter plot location is marked with the cursor and the original data items within that bin are highlighted.
Set this keyword to a named variable that contains an array to be added to the output of HISTOGRAM. The density function of Array is added to the existing contents of INPUT and returned as the result. The array is converted to longword type if necessary and must have at least as many elements as are required to form the histogram.
MAX is the maximum value to consider. Note that the data type of the value specified for MAX should match the data type of the input array; specifying mismatched data types may produce undesired results. If this keyword is not specified, Array is searched for its largest value.
MIN is the minimum value to consider. Note that the data type of the value specified for MIN should match the data type of the input array; specifying mismatched data types may produce undesired results. If this keyword is not specified, and Array is of type byte, 0 is used. If this keyword is not specified and Array is not of byte type, Array is searched for its smallest value.
Set this keyword to cause the routine to check for occurrences of the IEEE floating-point value NaN in the input data. Elements with the value NaN are treated as missing data. (See Special Floating-Point Values for more information on IEEE floating-point values.)
Set this keyword to a named variable in which the list of reverse indices is returned. This list is returned as a longword vector whose number of elements is the sum of the number of elements in the histogram, N , and the number of array elements included in the histogram, plus one.
The subscripts of the original array elements falling in the i th bin, 0 <= i < N , are given by the expression: R(R[i] : R(i+1)-1), where R is the reverse index list. If R[i] is equal to R[i+1], no elements are present in the i th bin.
The HISTOGRAM function can also be used to increment the elements of one vector whose subscripts are contained in another vector. To increment those elements of vector A indicated by vector B, use the command: