Let the numerical support of a probability distribution be . Its cumulative distribution function counts how many values have been passed:
It is zero below , equals on for , and is one at and above . Every jump is , even when the horizontal gaps differ.
For inverse transform sampling, take an ideal continuous uniform distribution for on . Partition that interval into intervals of width and output
Each interval has probability , proving the desired discrete uniform distribution. Using the floor function, the index is ; for consecutive integer values the output is . With the usual quantile function convention , one instead writes for , using the ceiling function. The endpoint conventions differ only at a finite set of points with probability zero under the ideal continuous uniform distribution.
For , the four intervals , , , and select , respectively. Thus selects , while selects . The upper half of the interval selects values at least four, recovering probability . Equal widths refer to the sampling probability coordinate, not to distances between output values. This is an exact mathematical construction assuming an ideal continuous uniform distribution; a finite computer random-number source needs its own justification of equal output chances.

Articles by others on the same topic (0)

There are currently no matching articles.