Categorical distribution Created 2026-09-24 Updated 2026-10-14
A categorical distribution describes one trial with one of labelled outcomes and probabilities summing to one. The labels need not be numbers or have an order. It is the single-trial building block of the multinomial distribution: independent draws with the same categorical distribution produce multinomial category counts.
For a trial choosing labels with probabilities , the category-indicator random vector is , , or . Its expected value is ; its components are dependent because exactly one is one. A numerical encoding of is a separate modelling choice: the category labels themselves do not define an arithmetic mean.
Suppose two independent random variables have the same categorical distribution, with label probabilities . The disjoint equal-label events giveFor the original chosen probabilities , this is , rather than the uniform four-label value . The Cauchy-Schwarz inequality gives , so uniform probabilities minimize this two-draw collision probability. This pair formula alone does not supply the entire group collision probability for a nonuniform model.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 36 2 g Solution Created 2026-10-03 Updated 2026-10-14
The WinBUGS model uses a finite truncation of the reciprocal prior. The numbered lines have the following roles:
- Line (1) forms , the normalized prior probability vector on the integer labels . The deterministic sum may be declared after its use because the model is declarative.
- Line (2) assigns that categorical distribution. The following observation model treats the supplied value as observed data, rather than as an unknown parameter.
- Line (3) forms observation probabilities for and zero for . For integer , the small positive offset in
step(N-j+0.01)includes the endpoint without depending on the convention at zero. There are exactly nonzero entries, so this vector sums to one.
Combining that categorical distribution observation likelihood with the truncated reciprocal prior producesThe Markov chain Monte Carlo output approximates this posterior. The actual PDF separates the observation line from the preceding comment; it must remain an active stochastic statement.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 207 3 c iii Solution Created 2026-09-24 Updated 2026-10-14
Bayes' theorem turns the categorical distribution prior probabilities and the component multivariate normal densities intoThese probabilities define the label update in the Gibbs sampler.