logo

Derivation of the Covariance Matrix of the Multinomial Distribution 📂Probability Distribution

Derivation of the Covariance Matrix of the Multinomial Distribution

Formula

If a random vector X:=(X1,,Xk)\mathbf{X} := \left( X_{1} , \cdots , X_{k} \right) follows a multinomial distribution Mk(n,p)M_{k} \left( n, \mathbf{p} \right), then its covariance matrix is as follows. Cov(X)=n[p1(1p1)p1p2p1pkp2p1p2(1p2)p2p2pkp1pkp2pk(1pk)] \operatorname{Cov} \left( \mathbf{X} \right) = n \begin{bmatrix} p_{1} \left( 1 - p_{1} \right) & - p_{1} p_{2} & \cdots & - p_{1} p_{k} \\ - p_{2} p_{1} & p_{2} \left( 1 - p_{2} \right) & \cdots & - p_{2} p_{2} \\ \vdots & \vdots & \ddots & \vdots \\ - p_{k} p_{1} & - p_{k} p_{2} & \cdots & p_{k} \left( 1 - p_{k} \right) \end{bmatrix}

Description

The components of the multinomial distribution are almost mutually exclusive rather than just non-independent because of the constraint that the sum of the random vector must be nn. Therefore, when iji \ne j, each component necessarily has a negative correlation.

Derivation 1

If i=ji = j then Cov(Xi,Xi)=Var(Xi)\operatorname{Cov} \left( X_{i} , X_{i} \right) = \Var \left( X_{i} \right) and XiX_{i}, each component independently follows a binomial distribution Bin(n,pi)\text{Bin} \left( n , p_{i} \right). Thus, the ii-th diagonal component of the covariance matrix becomes npi(1pi)n p_{i} \left( 1 - p_{i} \right).

Properties of the multinomial distribution: For iji \ne j, Xi+XjX_{i} + X_{j} follows a binomial distribution Bin(n,pi+pj)\text{Bin} \left( n , p_{i} + p_{j} \right). Xi+XjBin(n,pi+pj) X_{i} + X_{j} \sim \text{Bin} \left( n , p_{i} + p_{j} \right)

If iji \ne j, the bundle properties yield the following. Var(Xi+Xj)=VarXi+VarXj+2Cov(Xi,Xj)    n(pi+pj)(1pipj)=npi(1pi)+npj(1pj)+2Cov(Xi,Xj)    n(pi+pj)(pipj)=npi(pi)+npj(pj)+2Cov(Xi,Xj)    2npipj=2Cov(Xi,Xj)    Cov(Xi,Xj)=npipj \begin{align*} && \Var \left( X_{i} + X_{j} \right) =& \Var X_{i} + \Var X_{j} + 2 \operatorname{Cov} \left( X_{i} , X_{j} \right) \\ \implies && n \left( p_{i} + p_{j} \right) \left( 1 - p_{i} - p_{j} \right) =& n p_{i} \left( 1 - p_{i} \right) + n p_{j} \left( 1 - p_{j} \right)+ 2 \operatorname{Cov} \left( X_{i} , X_{j} \right) \\ \implies && n \left( p_{i} + p_{j} \right) \left( - p_{i} - p_{j} \right) =& n p_{i} \left( - p_{i} \right) + n p_{j} \left( - p_{j} \right)+ 2 \operatorname{Cov} \left( X_{i} , X_{j} \right) \\ \implies && - 2 n p_{i} p_{j} =& 2 \operatorname{Cov} \left( X_{i} , X_{j} \right) \\ \implies && \operatorname{Cov} \left( X_{i} , X_{j} \right) =& - n p_{i} p_{j} \end{align*}