1. Home

Probability in numbers

Statistics and Special Functions: Distributions, Tails and Quantiles

Plaster Gaussian hill with engraved contour rings on a square base (AI-generated image)
AI-generated image

Statistical software leans on a small family of special functions. The normal distribution rests on the error function, the chi-square and Poisson distributions on the incomplete gamma function, and the t and F distributions on the incomplete beta function. This section explains those building blocks and the calculations on top of them: densities, tail probabilities, quantiles and random draws.

The normal family

Everything starts with the bell curve. The normal probability density is the formula, and the area under it up to a point is the distribution function, which equals a shifted and rescaled error function. Going the other direction, from a probability to the point that has it, needs an inverse. The inverse error function page works one by hand and tabulates values, and the inverse normal distribution page treats the same job in terms of quantiles. A confidence level of 95 percent corresponds to the multiplier 1.96, and the rest of the family follows the same pattern.

Tails and tests

A p-value is a tail probability, the chance of a result at least as extreme as the observed one. For small samples it comes from the t distribution, and for comparing variances from the F distribution. The pages on the Student t tail and the F distribution tail show how those numbers are obtained. The incomplete gamma function, treated on its own page, serves chi-square tails and Poisson sums.

Random numbers

Simulation needs draws from named distributions. The usual recipe starts from uniform random numbers and transforms them, either by inverting the distribution function or by an acceptance scheme. Pages here cover binomial, gamma and Poisson generators, and a page on histograms for checking that the sample looks like its target.

Practical advice

Read tables and software output with the convention in mind. Some routines return the lower tail, some the upper tail, and some a two-sided probability; mixing them up doubles or halves a p-value without any visible sign.

Compute tails directly. For extreme events, subtracting a probability that is nearly 1 from 1 destroys the digits that matter, so careful code evaluates the small tail itself. And test any distribution routine at a few points whose values you know independently, for example the median of the normal distribution at 0.

Quantile and tail ideas in action appear in the overview of numerical methods in practice. Matrix methods for fitting models are in linear algebra, and the glossary defines the terms used.

Questions about statistics

What is a p-value?

A p-value is the probability, assuming the null hypothesis is true, of seeing a result at least as extreme as the one observed. It is not the probability that the hypothesis is true. A small value indicates that the data would be unusual under the null model, while a large one means only that the data are compatible with it.

When should I use the t distribution instead of the normal?

Use the t distribution when the population standard deviation is unknown and has to be estimated from a small sample. Its tails are heavier than the normal’s, which allows for the extra uncertainty. As the sample grows the two curves become nearly identical, and beyond a few dozen observations the difference is small.

What is the difference between a probability density and a probability?

A density gives relative likelihood at a point, and its values can exceed 1. Probabilities come from areas: the chance that a variable falls between two values is the integral of the density across that interval. For a continuous variable, the probability of any single exact value is zero.

How do I check that random numbers have the right distribution?

Generate a large sample and compare its mean, variance and histogram with the theoretical values. A binomial sample with n trials and probability p, for instance, should average near np. A histogram against the expected density, or a quantile comparison, shows shape problems that moments alone can miss.

Back to top