Definition of Congruent Covariance
📂Mathematical StatisticsDefinition of Congruent Covariance
Buildup
Let’s say we have samples drawn independently from a population with distribution X∼(μ,σ2), but these samples are actually composed of m different populations, (μ1,σ12),⋯,(μm,σm2), with n1,⋯,nm samples drawn from each, creating a collection of random samples.
{X1}n1∼iid⋮{Xm}nm∼iid(μ1,σ12)(μm,σm2)
Of course, the total number of samples is n=∑i=1mni. Since each population assumes iid, considering their order is meaningless, using the index Xk for the entire population makes us consider it as {Xk}k=1n∼(μ,σ2), and by using the index i, we represent the ith group’s random variable as Xi∼iid(μi,σi2). Now, we will refer to the original large population’s mean μ and σ2 as the Population Pooled Mean and Population Pooled Variance, respectively. The ultimate goal of this post is not simply to examine ’the definition of pooled variance’ but to derive the sample pooled variance Sp2, its unbiased estimator. Surprisingly, there is hardly a place online that has properly demonstrated this proof, so remember that you can see it here even if it’s not immediately needed.
Population Pooled Mean
Let’s first examine whether the population pooled mean and variance can be represented by their respective population means and variances. Following the definition of mean and variance, the population pooled mean is
nμ====n1μ+⋯nmμk=1∑nEXki=1∑mniEXin1μ1+⋯nmμm
therefore fulfilling
μ=n1+⋯+nmn1μ1+⋯nmμm
meaning the individual group’s population means appear as a weighted average based on the number of samples.
Population Pooled Variance
Similarly, though not iid, since Xk are independently sampled, according to the linearity of variance when independent,
nσ2======n1σ2+⋯nmσ2k=1∑nE(Xk−μ)2Ek=1∑n(Xk−μ)2Ei=1∑mniXi2−2Ei=1∑mniXiμi+i=1∑mniμi2Ei=1∑mni(Xi−μi)2n1σ12+⋯nmσm2
this results in
σ=n1+⋯+nmn1σ12+⋯nmσm2
where each group’s population variances appear as a weighted average weighted by the number of samples. Now, in the case where samples have Homoscedasticity, i.e., assuming only the population means differ and σ=σ1=⋯=σm, let’s look into the sample pooled variance Sp2, an unbiased estimator.
Sample Pooled Variance
{X1}n1∼iid⋮{Xm}nm∼iid(μ1,σ2)(μm,σ2)
Sample Pooled Variance Sp2 is represented as a weighted average of each sample variance S12,⋯,Sm2, weighted by their degrees of freedom.
Sp2:=(n1−1)+⋯+(nm−1)(n1−1)S12+⋯+(nm−1)Sm2=∑i=1m(ni−1)∑i=1m(ni−1)Si2
Thus defined, sample pooled variance Sp2 is an unbiased estimator of the population pooled variance σ2.
ESp2=σ2
Derivation
System of equations
S12=Sm2=n1−11j=1∑n1(X1−X1)2⋮nm−11j=1∑nm(Xm−Xm)2
from which we obtain the following. Here, j=1,⋯,ni is simply an index to repeat ni, and though we won’t specifically use Xij1 and Xij2 for convenience, we must remember that they are independent.
===i=1∑m(ni−1)Si2i=1∑mj=1∑nm(Xi−Xi)2i=1∑mj=1∑nm[(Xi−μi)+(μi−Xi)]2i=1∑mj=1∑nm[(Xi−μi)2−2(Xi−μi)(Xi−μi)+(Xi−μi)2]
Now, before taking the expected value on both sides, let’s examine the expected value for each term.
Properties of Covariance: For random variables X and Y, with means μX and μY respectively, Cov(X,Y):=E[(X−μX)(Y−μY)] is defined as the Covariance between X and Y. Covariance has the following properties:
- [1]: Var(X)=Cov(X,X)
- [4]: Cov(X+Y,Z)=Cov(X,Z)+Cov(Y,Z)
- [5]: Cov(aX+b,cY+d)=acCov(X,Y)
The first term is trivially E(Xi−μi)2=σi2. And Xi=∑jXi/ni since Xij1⊥Xij2 are iid, or independently drawn, we can state for any j0∈{1,⋯,nm},
=====E(Xi−μi)(Xi−μi)Cov(Xi,Xi)Cov(Xi,niXi)+j=j0∑Cov(Xij,niXij0)ni1Cov(Xi,Xi)+0ni1VarXini1σi2
and according to the standard error formula for sample means,
E(Xi−μi)2=ni1σi2
thus, assuming homoscedasticity σ=σ1=⋯=σm,
=====Ei=1∑m(ni−1)Si2i=1∑mj=1∑nmσi2−2i=1∑mj=1∑nmni1σi2+i=1∑mj=1∑nmni1σi2nσ2−i=1∑mσi2nσ2−mσ2(n−m)σ2i=1∑m(ni−1)σ2
leading us to the final result:
ESp2=E∑i=1m(ni−1)∑i=1m(ni−1)Si2=σ2
■