| Multinomial Distribution | |||
|---|---|---|---|
| Parameters | number of trials | ||
| Support | |||
| PMF | |||
| Mean | |||
| Variance | |||
| Entropy | |||
| MGF | |||
| CF | where | ||
| PGF | for | ||
Inprobability theory, themultinomial distribution is a generalization of thebinomial distribution. For example, it models the probability of counts for each side of ak-sided die rolledn times. Fornindependent trials each of which leads to a success for exactly one ofk categories, with each category having a given fixed success probability, the multinomial distribution gives the probability of any particular combination of numbers of successes for the various categories.
Whenk is 2 andn is 1, the multinomial distribution is theBernoulli distribution. Whenk is 2 andn is bigger than 1, it is thebinomial distribution. Whenk is bigger than 2 andn is 1, it is thecategorical distribution. The term "multinoulli" is sometimes used for the categorical distribution to emphasize this four-way relationship (son determines the suffix, andk the prefix).
TheBernoulli distribution models the outcome of a singleBernoulli trial. In other words, it models whether flipping a (possiblybiased) coin one time will result in either a success (obtaining a head) or failure (obtaining a tail). Thebinomial distribution generalizes this to the number of heads from performingn independent flips (Bernoulli trials) of the same coin. The multinomial distribution models the outcome ofn experiments, where the outcome of each trial has acategorical distribution, such as rolling a (possiblybiased)k-sided dien times.
Letk be a fixed finite number. Mathematically, we havek possible mutually exclusive outcomes, with corresponding probabilitiesp1, ...,pk, andn independent trials. Since thek outcomes are mutually exclusive and one must occur we havepi ≥ 0 fori = 1, ..., k and. Then if the random variablesXi indicate the number of times outcome numberi is observed over then trials, the vectorX = (X1, ..., Xk) follows a multinomial distribution with parametersn andp, wherep = (p1, ..., pk). While the trials are independent, their outcomesXi are dependent because they must sum to n.
Suppose one does an experiment of extractingn balls ofk different colors from a bag, replacing the extracted balls after each draw. Balls of the same color are equivalent. Denote the variable which is the number of extracted balls of colori (i = 1, ...,k) asXi, and denote aspi the probability that a given extraction will be in colori. Theprobability mass function of this multinomial distribution is:
for non-negative integersx1, ...,xk.
The probability mass function can be expressed using thegamma function as:
This form shows its resemblance to theDirichlet distribution, which is itsconjugate prior.
Suppose that in a three-way election for a large country, candidate A received 20% of the votes, candidate B received 30% of the votes, and candidate C received 50% of the votes. If six voters are selected randomly, what is the probability that there will be exactly one supporter for candidate A, two supporters for candidate B and three supporters for candidate C in the sample?
Note: Since we’re assuming that the voting population is large, it is reasonable and permissible to think of the probabilities as unchanging once a voter is selected for the sample. Technically speaking this is sampling without replacement, so the correct distribution is themultivariate hypergeometric distribution, but the distributions converge as the population grows large in comparison to a fixed sample size.[1]
The multinomial distribution is normalized according to:
where the sum is over all permutations ofsuch that.
Theexpected number of times the outcomei was observed overn trials is
Thecovariance matrix is as follows. Each diagonal entry is thevariance of a binomially distributed random variable, and is therefore
The off-diagonal entries are thecovariances:
fori,j distinct.
All covariances are negative because for fixedn, an increase in one component of a multinomial vector requires a decrease in another component.
When these expressions are combined into a matrix withi, j element the result is ak ×kpositive-semidefinitecovariance matrix of rankk − 1. In the special case wherek = n and where thepi are all equal, the covariance matrix is thecentering matrix.
The entries of the correspondingcorrelation matrix are
Note that the number of trialsn drops out of this expression.
Each of thek components separately has a binomial distribution with parametersn andpi, for the appropriate value of the subscripti.
Thesupport of the multinomial distribution is the set
Its number of elements is
In matrix notation,
and
withpT = therow vector transpose of the column vectorp.
Just like one can interpret thebinomial distribution as (normalized) one-dimensional (1D) slices ofPascal's triangle, so too can one interpret the multinomial distribution as 2D (triangular) slices ofPascal's pyramid, or 3D/4D/+ (pyramid-shaped) slices of higher-dimensional analogs of Pascal's triangle. This reveals an interpretation of therange of the distribution: discretized equilateral "pyramids" in arbitrary dimension—i.e. asimplex with a grid.[citation needed]
Similarly, just like one can interpret thebinomial distribution as the polynomial coefficients of when expanded, one can interpret the multinomial distribution as the coefficients of when expanded, noting that just the coefficients must sum up to 1.
ByStirling's formula, at the limit of, we havewhere relative frequencies in the data can be interpreted as probabilities from the empirical distribution, and is theKullback–Leibler divergence.
This formula can be interpreted as follows.
Consider, the space of all possible distributions over the categories. It is asimplex. After independent samples from the categorical distribution (which is how we construct the multinomial distribution), we obtain an empirical distribution.
By the asymptotic formula, the probability that empirical distribution deviates from the actual distribution decays exponentially as we sample more data, at a rate of. The more experiments and the more different is from, the less likely it is to see such an empirical distribution.
If is a closed subset of, then by dividing up into pieces, and reasoning about the growth rate of on each piece, we obtainSanov's theorem, which states that
Due to theexponential decay, at large, almost all the probability mass is concentrated in a small neighborhood of. In this small neighborhood, we can take the first nonzero term in theTaylor expansion of, to obtainThis resembles the Gaussian distribution, which suggests the following theorem:
Theorem. At the limit,converges in distribution to thechi-squared distribution.
The space of all distributions over categories is asimplex:, and the set of all possible empirical distributions after experiments is a subset of the simplex:. That is, it is the intersection between and the lattice.
As increases, most of the probability mass is concentrated in a subset of near, and the probability distribution near becomes well-approximated byFrom this, we see that the subset upon which the mass is concentrated has radius on the order of, but the points in the subset are separated by distance on the order of, so at large, the points merge into a continuum.To convert this from a discrete probability distribution to a continuous probability density, we need to multiply by the volume occupied by each point of in. However, by symmetry, every point occupies exactly the same volume (except a negligible set on the boundary), so we obtain a probability density, where is a constant.
Finally, since the simplex is not all of, but only within a-dimensional plane, we obtain the desired result.
The above concentration phenomenon can be easily generalized to the case where we condition upon independent constraints. This is the theoretical justification forPearson's chi-squared test.
Theorem.
In the case that all are equal, this reduces to the concentration of entropies around themaximum entropy.[2][3]
This theorem can be shown by starting with the previous case, then taking the conditional on the constraints.
In some fields such asnatural language processing, categorical and multinomial distributions are synonymous and it is common to speak of a multinomial distribution when acategorical distribution is actually meant. This stems from the fact that it is sometimes convenient to express the outcome of a categorical distribution as a "1-of-k" vector (a vector with one element containing a 1 and all other elements containing a 0) rather than as an integer in the range; in this form, a categorical distribution is equivalent to a multinomial distribution over a single trial.
This sectionneeds expansion with: A new sub-section about simultaneous confidence intervals (with proper citations, e.g.:[1]).. You can help byadding to it.(March 2024) |
The goal of equivalence testing is to establish the agreement between a theoretical multinomial distribution and observed counting frequencies. The theoretical distribution may be a fully specified multinomial distribution or a parametric family of multinomial distributions.
Let denote a theoretical multinomial distribution and let be a true underlying distribution. The distributions and are considered equivalent if for a distance and a tolerance parameter. The equivalence test problem is versus. The true underlying distribution is unknown. Instead, the counting frequencies are observed, where is a sample size. An equivalence test uses to reject. If can be rejected then the equivalence between and is shown at a given significance level. The equivalence test for Euclidean distance can be found in text book of Wellek (2010).[4] The equivalence test for the total variation distance is developed in Ostrovski (2017).[5] The exact equivalence test for the specific cumulative distance is proposed in Frey (2009).[6]
The distance between the true underlying distribution and a family of the multinomial distributions is defined by. Then the equivalence test problem is given by and. The distance is usually computed using numerical optimization. The tests for this case are developed recently in Ostrovski (2018).[7]
In the setting of a multinomial distribution, constructing confidence intervals for the difference between the proportions of observations from two events,, requires the incorporation of the negative covariance between the sample estimators and.
Some of the literature on the subject focused on the use-case of matched-pairs binary data, which requires careful attention when translating the formulas to the general case of for any multinomial distribution. Formulas in the current section will be generalized, while formulas in the next section will focus on the matched-pairs binary data use-case.
Wald's standard error (SE) of the difference of proportion can be estimated using:[8]: 378 [9]
For aapproximate confidence interval, themargin of error may incorporate the appropriate quantile from thestandard normal distribution, as follows:
As the sample size () increases, the sample proportions will approximately follow amultivariate normal distribution, thanks to themultidimensional central limit theorem (and it could also be shown using theCramér–Wold theorem). Therefore, their difference will also be approximately normal. Also, these estimators areweakly consistent and plugging them into the SE estimator makes it also weakly consistent. Hence, thanks toSlutsky's theorem, thepivotal quantity approximately follows thestandard normal distribution. And from that, the aboveapproximate confidence interval is directly derived.
The SE can be constructed using the calculus ofthe variance of the difference of two random variables:
A modification which includes acontinuity correction adds to the margin of error as follows:[10]: 102–103
Another alternative is to rely on a Bayesian estimator usingJeffreys prior which leads to using adirichlet distribution, with all parameters being equal to 0.5, as a prior. The posterior will be the calculations from above, but after adding 1/2 to each of thek elements, leading to an overall increase of the sample size by. This was originally developed for a multinomial distribution with four events, and is known aswald+2, for analyzing matched pairs data (see the next section for more details).[11]
This leads to the following SE:
Which can just be plugged into the original Wald formula as follows:
For the case of matched-pairs binary data, a common task is to build the confidence interval of the difference of the proportion of the matched events. For example, we might have a test for some disease, and we may want to check the results of it for some population at two points in time (1 and 2), to check if there was a change in the proportion of the positives for the disease during that time.
Such scenarios can be represented using a two-by-twocontingency table with the number of elements that had each of the combination of events. We can use smallf for sampling frequencies:, and capitalF for population frequencies:. These four combinations could be modeled as coming from a multinomial distribution (with four potential outcomes). The sizes of the sample and population can ben andN respectively. And in such a case, there is an interest in building a confidence interval for the difference of proportions from the marginals of the following (sampled) contingency table:
| Test 2 positive | Test 2 negative | Row total | |
| Test 1 positive | |||
| Test 1 negative | |||
| Column total |
In this case, checking the difference in marginal proportions means we are interested in using the following definitions:,.And the difference we want to build confidence intervals for is:
Hence, a confidence intervals for the marginal positive proportions () is the same as building a confidence interval for the difference of the proportions from the secondary diagonal of the two-by-two contingency table ().
Calculating ap-value for such a difference is known asMcNemar's test. Building confidence interval around it can be constructed using methods described above forConfidence intervals for the difference of two proportions.
The Wald confidence intervals from the previous section can be applied to this setting, and appears in the literature using alternative notations. Specifically, the SE often presented is based on the contingency table frequencies instead of the sample proportions. For example, the Wald confidence intervals, provided above, can be written as:[10]: 102–103
Further research in the literature has identified several shortcomings in both the Wald and the Wald with continuity correction methods, and other methods have been proposed for practical application.[10]
One such modification includesAgresti and Min’s Wald+2 (similar to some of their other works[12]) in which each cell frequency had an extra added to it.[11] This leads to theWald+2 confidence intervals. In a Bayesian interpretation, this is like building the estimators taking as prior adirichlet distribution with all parameters being equal to 0.5 (which is, in fact, theJeffreys prior). The+2 in the namewald+2 can now be taken to mean that in the context of a two-by-two contingency table, which is a multinomial distribution with four possible events, then since we add 1/2 an observation to each of them, then this translates to an overall addition of 2 observations (due to the prior).
This leads to the following modified SE for the case of matched pairs data:
Which can just be plugged into the original Wald formula as follows:
Other modifications includeBonett and Price’s Adjusted Wald, andNewcombe’s Score.
First, reorder the parameters such that they are sorted in descending order (this is only to speed up computation and not strictly necessary). Now, for each trial, draw an auxiliary variableX from a uniform (0, 1) distribution. The resulting outcome is the component
{Xj = 1,Xk = 0 fork ≠ j } is one observation from the multinomial distribution with andn = 1. A sum of independent repetitions of this experiment is an observation from a multinomial distribution withn equal to the number of such repetitions.
Given the parameters and a total for the sample such that, it is possible to sample sequentially for the number in an arbitrary state, by partitioning the state space into and not-, conditioned on any prior samples already taken, repeatedly.
S=nrho=1foriin[1,k-1]:ifrho!=0:X[i]~Binom(S,p[i]/rho)elseX[i]=0S=S-X[i]rho=rho-p[i]X[k]=S
Heuristically, each application of the binomial sample reduces the available number to sample from and the conditional probabilities are likewise updated to ensure logical consistency.[13]