How to simulate relative frequency outcomes of a multinomial experiment using normally distributed random numbers? The answer is surprisingly simple, but for some curious reason, it is seldom mentioned on the internet.
Let X=(X1,…,Xm)i.i.d.∼Multinomial(n,p), where p=(p1,…,pm) is a probability vector whose entries sum to 1. In other words, we are talking about n independent trials of a multinomial experiement, in which the probability of getting outcome i∈{1,2,…,m} in each trial is pi, and Xi is the frequency count for outcome i after all n trials are completed. We have the following:
Theorem. Let u=(√p1,…,√pm) and Q be a real orthogonal matrix whose last column is u. Suppose Z1,…,Zm−1 are m−1 i.i.d. standard normal random variables. Then
X∗=(Xi−npi√npi)1≤i≤md⟶Q[Z1⋮Zm−10]as n→∞.
Proof. See sec. 11.1 of Hans-Otto Georgii (2007), Stochastics: Introduction to Probability and Statistics, Walter de Gruyter, Berlin.
*****************************
Note that the denominator of the i-th entry of X∗ in the above theorem is √npi, not the usual √npi(1−pi) we see in the normal approximation formula to binomial distribution. We will immediately see why the binomial case is just a special case of the above general formula. Let m=2 and write p=(p,q)⊤. Take Q as (√q√p−√p√q). So, the above theorem says that
[X1−np√npX2−nq√nq]d⟶(√q√p−√p√q)[z0]=[√qZ−√pZ].Hence, by Continuous Mapping Theorem, we can divide both sides entrywise by (√q,−√p)⊤ and get
[X1−np√npqnq−X2√npq]d⟶[ZZ].
Since X1+X2=n, we have nq−X2=X1−np. Hence the above convergence reduces to the familiar normal approximation formula to binomial distribution.
The theorem requires the use of a real orthogonal matrix Q whose last column is u. How to construct such a matrix? See my previous blog entry.
By the theorem, the covariance matrix of the approximating distribution is given by Q diag(1,…,1,0) Q⊤=I−uu⊤. This matrix is, of course, degenerate because the Xi's are not independent of each other (as ∑mi=1Xi=n).
2012年9月15日星期六
訂閱:
發佈留言 (Atom)
沒有留言:
發佈留言