Menu Close

Mahalanobis’s D² and Hotelling’s T²: UPSC Statistics Optional PYQ Solutions (1995–2026)

All 24 questions UPSC has asked on Mahalanobis’s D² and Hotelling’s T² in the Statistics Optional (Paper I, Linear Inference and Multivariate Analysis) from 1995 to 2026, solved step by step – latest first.

Try them yourself first: the same questions, without solutions, are on our Linear Inference and Multivariate Analysis topic-wise PYQs page.

How we check these solutions

These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:

  • ✓ Checked by computer the numbers were worked out again independently in code (Python with NumPy/SciPy) and matched.
  • ✓ Proof checked step by step for “prove that” and “examine whether” questions, every step was checked against the definitions and the standard theorems.
  • ✓ Derivation checked step by step for derivations and approximations, every step was checked, and the result was also tested numerically.
  • ✓ Answer checked step by step for descriptive questions, every point was checked against the standard theory.

Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.

Jump to a question (year · question number):

2026 · 6b 2024 · 5c 2022 · 7b 2020 · 6c 2020 · 7a 2019 · 6c 2018 · 8b 2017 · 7b 2016 · 5e 2016 · 8b 2015 · 5a 2014 · 5b 2014 · 7b 2013 · 6b 2013 · 7b 2012 · 7b 2005 · 6c 2002 · 5f 2000 · 6b(ii) 1999 · 12b 1998 · 12a 1997 · 12a 1996 · 12a 1995 · 12a

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Let 𝐗1,𝐗2,⋯,𝐗N be a random sample from Np(𝛍,Σ). Show that Hotelling’s T2-statistic for testing H0:𝛍=𝛍0 against H1:𝛍≠𝛍0 is a generalization of t-statistic for testing H0:μ=μ0 against H1:μ≠μ0 in the univariate case. Calculate T2-statistic for testing H0:𝛍=(95) on the basis of the data taken from a bivariate normal distribution given below: X=(6910683)

2026 · Paper I · Q6b · 15 marks

Solution

T2T^2 generalises tt. In the univariate case, with X1,…,XNX_1,\dots,X_N from N(μ,σ2)N(\mu,\sigma^2), t=N(X‾−μ0)s,t2=N(X‾−μ0)(s2)−1(X‾−μ0)∼F1,N−1under H0.t=\frac{\sqrt N(\bar X-\mu_0)}{s},\qquad t^2=N(\bar X-\mu_0)(s^2)^{-1}(\bar X-\mu_0)\sim F_{1,N-1}\ \text{under }H_0 . For pp variables, replace the scalar deviation by the vector X‾−μ0\bar X-\mu_0 and the scalar s2s^2 by the unbiased sample covariance matrix SS: T2=N(X‾−μ0)′S−1(X‾−μ0),N−p(N−1)pT2∼Fp,N−punder H0.T^2=N(\bar X-\mu_0)'S^{-1}(\bar X-\mu_0),\qquad\frac{N-p}{(N-1)p}T^2\sim F_{p,\,N-p}\ \text{under }H_0 . For p=1p=1, S=s2S=s^2 and T2=t2T^2=t^2, and the FF statement reduces to t2∼F1,N−1t^2\sim F_{1,N-1}. Moreover, T2T^2 is the largest value of t2t^2 over all linear combinations a′Xa'X: T2=maxaN{a′(X‾−μ0)}2a′Sa,T^2=\max_a\frac{N\{a'(\bar X-\mu_0)\}^2}{a'Sa}, so it is the natural multivariate extension of Student’s tt.

Calculation. N=3N=3, p=2p=2. x‾=13(6+10+89+6+3)=(86).\bar x=\frac13\begin{pmatrix}6+10+8\\9+6+3\end{pmatrix}=\begin{pmatrix}8\\6\end{pmatrix}. Deviations: (−2,3)(-2,3), (2,0)(2,0), (0,−3)(0,-3). So S=1N−1∑(x−x‾)(x−x‾)′=12(8−6−618)=(4−3−39).S=\frac1{N-1}\sum(x-\bar x)(x-\bar x)'=\frac12\begin{pmatrix}8&-6\\-6&18\end{pmatrix}=\begin{pmatrix}4&-3\\-3&9\end{pmatrix}. |S|=36−9=27|S|=36-9=27, so S−1=127(9334)S^{-1}=\frac1{27}\begin{pmatrix}9&3\\3&4\end{pmatrix}.

With x‾−μ0=(8−9,6−5)′=(−1,1)′\bar x-\mu_0=(8-9,\ 6-5)'=(-1,1)': T2=3⋅127(−1,1)(9334)(−11)=19(9−3−3+4)=79=0.778.T^2=3\cdot\frac1{27}(-1,1)\begin{pmatrix}9&3\\3&4\end{pmatrix}\begin{pmatrix}-1\\1\end{pmatrix}=\frac19(9-3-3+4)=\frac79=0.778 .

Decision. F=N−p(N−1)pT2=14×0.778=0.194F=\dfrac{N-p}{(N-1)p}T^2=\dfrac{1}{4}\times0.778=0.194 on (2,1)(2,1) df. This is far below F0.05(2,1)=199.5F_{0.05}(2,1)=199.5 (and even F0.10(2,1)=49.5F_{0.10}(2,1)=49.5), so we do not reject H0:μ=(9,5)′H_0:\mu=(9,5)'. With only 3 observations the test has very little power.

✓ Checked by computer We checked in Python: x̄ = (8, 6), S = [[4, −3], [−3, 9]], T² = 7/9 = 0.778 and F = 0.194, far below the upper 10% and 5% points of F(2, 1).

↑ Back to the question list

X1 and X2 are independent data sets of order (n1×p) and (n2×p) respectively from Np(μ∼,Σ). Show that n1n2D2n is distributed as T2(p,n−2), where n=n1+n2, and T2 and D2 represent the Hotelling’s T2 and Mahalanobis D2 respectively.

2024 · Paper I · Q5c · 10 marks

Solution

Set-up. The rows of X1X_1 (n1×pn_1\times p) and X2X_2 (n2×pn_2\times p) are independent Np(μ,Σ)N_p(\mu,\Sigma), so both samples come from the same population. Let x‾1,x‾2\bar x_1,\bar x_2 be the sample mean vectors and Ai=∑α=1ni(xiα−x‾i)(xiα−x‾i)′,S=A1+A2n−2,n=n1+n2.A_i=\sum_{\alpha=1}^{n_i}(x_{i\alpha}-\bar x_i)(x_{i\alpha}-\bar x_i)',\qquad S=\frac{A_1+A_2}{n-2},\quad n=n_1+n_2 . The sample Mahalanobis distance is D2=(x‾1−x‾2)′S−1(x‾1−x‾2).D^2=(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2).

Recall. If Y∼Np(0,Σ)Y\sim N_p(0,\Sigma) and A∼Wp(Σ,m)A\sim W_p(\Sigma,m) are independent, then mY′A−1Y=Y′(A/m)−1YmY'A^{-1}Y=Y'(A/m)^{-1}Y has the Hotelling T2(p,m)T^2(p,m) distribution, with m−p+1mpT2∼Fp,m−p+1.\frac{m-p+1}{mp}T^2\sim F_{p,\,m-p+1}.

Step 1 (numerator). x‾1∼Np(μ,Σ/n1)\bar x_1\sim N_p(\mu,\Sigma/n_1) and x‾2∼Np(μ,Σ/n2)\bar x_2\sim N_p(\mu,\Sigma/n_2) independently, so x‾1−x‾2∼Np(0,(1n1+1n2)Σ)=Np(0,nn1n2Σ).\bar x_1-\bar x_2\sim N_p\Big(0,\Big(\frac1{n_1}+\frac1{n_2}\Big)\Sigma\Big)=N_p\Big(0,\frac n{n_1n_2}\Sigma\Big). Hence Y=n1n2n(x‾1−x‾2)∼Np(0,Σ).Y=\sqrt{\frac{n_1n_2}{n}}\,(\bar x_1-\bar x_2)\sim N_p(0,\Sigma).

Step 2 (denominator). Ai∼Wp(Σ,ni−1)A_i\sim W_p(\Sigma,n_i-1), independently, so by the additive property of the Wishart distribution A=A1+A2∼Wp(Σ,n−2),S=An−2.A=A_1+A_2\sim W_p(\Sigma,\,n-2),\qquad S=\frac A{n-2}.

Step 3 (independence). Within each normal sample the mean vector is independent of the matrix of sums of squares and products, and the two samples are independent. So YY (a function of x‾1,x‾2\bar x_1,\bar x_2) is independent of AA.

Conclusion. n1n2nD2=Y′S−1Y=(n−2)Y′A−1Y∼T2(p,n−2),\frac{n_1n_2}{n}D^2=Y'S^{-1}Y=(n-2)\,Y'A^{-1}Y\ \sim\ T^2(p,\,n-2), and equivalently n−p−1(n−2)p⋅n1n2nD2∼Fp,n−p−1.◼\frac{n-p-1}{(n-2)p}\cdot\frac{n_1n_2}{n}D^2\sim F_{p,\,n-p-1}. \qquad\blacksquare This is the statistic for testing the equality of two mean vectors.

✓ Proof checked step by step We checked the proof: the distribution of the difference of the two sample means, the Wishart distribution of the pooled sums of squares and products, and their independence.

↑ Back to the question list

(i) The data matrix of a random sample of size n=3 from a bivariate normal population BVN(μ1,μ2,σ12,σ22,ρ) is X=[61010682]. Test the null hypothesis H0:𝛍=𝛍0 against H1:𝛍≠𝛍0, where 𝛍0′=(8,5), at 10% level of significance. [You are given: F0.10;2,1=49.5,F0.10;1,2=8.53] (ii) Suppose n1=11 and n2=12, observations are made on two random vectors 𝐗1 and 𝐗2 which are assumed to have bivariate normal distribution with a common covariance matrix Σ, but possibly different mean vectors 𝛍1 and 𝛍2. The sample mean vectors and pooled covariance matrix are 𝐗‾1=(−1−1),𝐗‾2=(21),Spooled=(7−1−15). Obtain Mahalanobis sample distance D2 and Fisher’s linear discriminant function. Assign the observation 𝐗0=(01) to either population Π1 or Π2.

2022 · Paper I · Q7b · 20 marks

Solution

(i) One-sample test. N=3N=3, p=2p=2. x‾=((6+10+8)/3(10+6+2)/3)=(86).\bar x=\begin{pmatrix}(6+10+8)/3\\(10+6+2)/3\end{pmatrix}=\begin{pmatrix}8\\6\end{pmatrix}. Deviations: (−2,4)(-2,4), (2,0)(2,0), (0,−4)(0,-4): S=12(8−8−832)=(4−4−416),|S|=48,S−1=148(16444).S=\frac12\begin{pmatrix}8&-8\\-8&32\end{pmatrix}=\begin{pmatrix}4&-4\\-4&16\end{pmatrix},\qquad|S|=48,\qquad S^{-1}=\frac1{48}\begin{pmatrix}16&4\\4&4\end{pmatrix}. With x‾−μ0=(0,1)′\bar x-\mu_0=(0,1)': T2=N(x‾−μ0)′S−1(x‾−μ0)=3⋅448=0.25.T^2=N(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0)=3\cdot\frac4{48}=0.25 . F=N−p(N−1)pT2=14(0.25)=0.0625on (2,1) df.F=\frac{N-p}{(N-1)p}T^2=\frac1{4}(0.25)=0.0625\quad\text{on }(2,1)\text{ df}. Since 0.0625<F0.10;2,1=49.50.0625<F_{0.10;2,1}=49.5, we do not reject H0:μ=(8,5)′H_0:\mu=(8,5)' at the 10% level.

(ii) Mahalanobis distance. x‾1−x‾2=(−3,−2)′\bar x_1-\bar x_2=(-3,-2)'. With |Sp|=35−1=34|S_p|=35-1=34, Sp−1=134(5117),a=Sp−1(x‾1−x‾2)=134(−15−2−3−14)=(−0.5−0.5).S_p^{-1}=\frac1{34}\begin{pmatrix}5&1\\1&7\end{pmatrix},\qquad a=S_p^{-1}(\bar x_1-\bar x_2)=\frac1{34}\begin{pmatrix}-15-2\\-3-14\end{pmatrix}=\begin{pmatrix}-0.5\\-0.5\end{pmatrix}. D2=(x‾1−x‾2)′Sp−1(x‾1−x‾2)=(−3)(−0.5)+(−2)(−0.5)=2.5.D^2=(\bar x_1-\bar x_2)'S_p^{-1}(\bar x_1-\bar x_2)=(-3)(-0.5)+(-2)(-0.5)=2.5 .

Fisher’s linear discriminant function. y=a′x=−0.5x1−0.5x2.y=a'x=-0.5x_1-0.5x_2 . Its values at the two means are y‾1=a′x‾1=1\bar y_1=a'\bar x_1=1 and y‾2=a′x‾2=−1.5\bar y_2=a'\bar x_2=-1.5, with midpoint m=12(y‾1+y‾2)=−0.25.m=\tfrac12(\bar y_1+\bar y_2)=-0.25 . Rule (equal priors and costs): assign xx to Π1\Pi_1 if a′x≥ma'x\ge m, and to Π2\Pi_2 otherwise.

Classification of x0=(0,1)′x_0=(0,1)'. y0=−0.5(0)−0.5(1)=−0.5<−0.25y_0=-0.5(0)-0.5(1)=-0.5<-0.25. So x0x_0 is assigned to Π2\Pi_2.

✓ Checked by computer We checked in Python: (i) T² = 0.25 and F = 0.0625 < 49.5; (ii) the discriminant coefficients (−0.5, −0.5), D² = 2.5, the midpoint −0.25 and the score −0.5 of x₀.

↑ Back to the question list

Let n=4, p=2, X=(X1X2), where X1: weight (in kg), X2: height (in cm) of infant. Sample data matrix X=[3.04.03.03.040403035] Test at 5% level of significance the null hypothesis H0:μ=μ0=(3.035.0). [Given that: F((2,2),0.05)=19.00].

2020 · Paper I · Q6c · 20 marks

Solution

Data. The columns of the given matrix are the N=4N=4 infants; p=2p=2. x‾=(13/4145/4)=(3.2536.25).\bar x=\begin{pmatrix}13/4\\145/4\end{pmatrix}=\begin{pmatrix}3.25\\36.25\end{pmatrix}.

Sample covariance matrix (divisor N−1=3N-1=3). Deviations (x1−3.25,x2−36.25)(x_1-3.25,\ x_2-36.25): (−0.25,3.75)(-0.25,3.75), (0.75,3.75)(0.75,3.75), (−0.25,−6.25)(-0.25,-6.25), (−0.25,−1.25)(-0.25,-1.25). ∑d12=0.75,∑d1d2=3.75,∑d22=68.75,\sum d_1^2=0.75,\qquad\sum d_1d_2=3.75,\qquad\sum d_2^2=68.75, S=(0.251.251.2522.917),|S|=5.729−1.5625=4.1667.S=\begin{pmatrix}0.25&1.25\\1.25&22.917\end{pmatrix},\qquad|S|=5.729-1.5625=4.1667 . S−1=14.1667(22.917−1.25−1.250.25).S^{-1}=\frac1{4.1667}\begin{pmatrix}22.917&-1.25\\-1.25&0.25\end{pmatrix}.

T2T^2. With x‾−μ0=(0.25,1.25)′\bar x-\mu_0=(0.25,1.25)': (x‾−μ0)′S−1(x‾−μ0)=22.917(0.0625)−2(1.25)(0.3125)+0.25(1.5625)4.1667=1.4323−0.78125+0.39064.1667=0.25,(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0)=\frac{22.917(0.0625)-2(1.25)(0.3125)+0.25(1.5625)}{4.1667}=\frac{1.4323-0.78125+0.3906}{4.1667}=0.25, T2=4×0.25=1.00.T^2=4\times0.25=1.00 .

Test. F=N−p(N−1)pT2=26(1.00)=0.333on (2,2) df.F=\frac{N-p}{(N-1)p}T^2=\frac{2}{6}(1.00)=0.333\quad\text{on }(2,2)\text{ df}. Since 0.333<F0.05(2,2)=19.000.333<F_{0.05}(2,2)=19.00, we do not reject H0H_0: the data are consistent with mean weight 3.0 kg and mean height 35.0 cm.

✓ Checked by computer We checked in Python: x̄ = (3.25, 36.25), S = [[0.25, 1.25], [1.25, 22.917]], T² = 1 and F = 1/3 < 19.

↑ Back to the question list

Define Hotelling’s-T2. Show that T2 statistic is a function of likelihood ratio criteria.

2020 · Paper I · Q7a · 20 marks

Solution

Definition. Let X1,…,XNX_1,\dots,X_N be a random sample from Np(μ,Σ)N_p(\mu,\Sigma), with X‾\bar X and S=A/(N−1)S=A/(N-1), A=∑(Xα−X‾)(Xα−X‾)′A=\sum(X_\alpha-\bar X)(X_\alpha-\bar X)'. For testing H0:μ=μ0H_0:\mu=\mu_0, Hotelling’s T2T^2 is T2=N(X‾−μ0)′S−1(X‾−μ0),T^2=N(\bar X-\mu_0)'S^{-1}(\bar X-\mu_0), and under H0H_0, N−p(N−1)pT2∼Fp,N−p\dfrac{N-p}{(N-1)p}T^2\sim F_{p,N-p}.

Likelihood ratio. The likelihood is L(μ,Σ)=(2π)−Np/2|Σ|−N/2exp{−12∑α(xα−μ)′Σ−1(xα−μ)}.L(\mu,\Sigma)=(2\pi)^{-Np/2}|\Sigma|^{-N/2}\exp\Big\{-\tfrac12\sum_\alpha(x_\alpha-\mu)'\Sigma^{-1}(x_\alpha-\mu)\Big\}. For fixed μ\mu, it is maximised at Σ̂(μ)=1N∑(xα−μ)(xα−μ)′\hat\Sigma(\mu)=\frac1N\sum(x_\alpha-\mu)(x_\alpha-\mu)', and then maxΣL(μ,Σ)=(2π)−Np/2|Σ̂(μ)|−N/2e−Np/2.\max_\Sigma L(\mu,\Sigma)=(2\pi)^{-Np/2}\,|\hat\Sigma(\mu)|^{-N/2}e^{-Np/2}.

  • Under H1H_1 (unrestricted): μ̂=x‾\hat\mu=\bar x, Σ̂=A/N\hat\Sigma=A/N.
  • Under H0H_0: μ=μ0\mu=\mu_0, Σ̂0=1N∑(xα−μ0)(xα−μ0)′=1N{A+N(x‾−μ0)(x‾−μ0)′}\hat\Sigma_0=\frac1N\sum(x_\alpha-\mu_0)(x_\alpha-\mu_0)'=\frac1N\big\{A+N(\bar x-\mu_0)(\bar x-\mu_0)'\big\}.

So λ=maxH0LmaxL=(|A||A+N(x‾−μ0)(x‾−μ0)′|)N/2.\lambda=\frac{\max_{H_0}L}{\max L}=\left(\frac{|A|}{|A+N(\bar x-\mu_0)(\bar x-\mu_0)'|}\right)^{N/2}.

Link with T2T^2. For a non-singular matrix AA and a vector dd, |A+dd′|=|A|(1+d′A−1d)|A+dd'|=|A|(1+d'A^{-1}d). With d=N(x‾−μ0)d=\sqrt N(\bar x-\mu_0): |A+N(x‾−μ0)(x‾−μ0)′|=|A|{1+N(x‾−μ0)′A−1(x‾−μ0)}=|A|(1+T2N−1).|A+N(\bar x-\mu_0)(\bar x-\mu_0)'|=|A|\big\{1+N(\bar x-\mu_0)'A^{-1}(\bar x-\mu_0)\big\}=|A|\Big(1+\frac{T^2}{N-1}\Big). Therefore λ2/N=11+T2/(N−1).\lambda^{2/N}=\frac1{1+T^2/(N-1)} . λ\lambda is a decreasing function of T2T^2, so the likelihood ratio test “reject H0H_0 when λ\lambda is small” is the same as “reject H0H_0 when T2T^2 is large”. The T2T^2 test is the likelihood ratio test. ◼\blacksquare

✓ Proof checked step by step We checked the derivation: the maximised likelihoods under H₀ and H₁, and the determinant identity that turns the likelihood ratio into a function of T².

↑ Back to the question list

Consider two independent i.i.d samples, each of size 10, from two bivariate normal populations. The results are summarised below. x‾1=(31),x‾2=(11),S1=(4−1−12),S2=(2−2−24), where Sj, j=1,2 are sample covariance matrices and x‾j, j=1,2 are sample means. Provide suitable tests for the following hypotheses at level α=0.05 and draw your conclusion. (i) H0:𝛍1=(2.51) (ii) H0:𝛍1=𝛍2 (iii) H0:μ11+2μ12=4, where 𝛍1=(μ11,μ12)′ (You can use the following values: F0.95,2,17=3.5915, F0.95,2,18=3.55, F0.95,1,19=4.38)

2019 · Paper I · Q6c · 20 marks

Solution

Note on the question. The supplied table values do not all match the natural degrees of freedom: test (i) uses the first sample only, so its FF has (2,8)(2,8) df, and (iii) has (1,9)(1,9) df ((1,18)(1,18) with the pooled matrix). We use the correct degrees of freedom (F0.95,2,8=4.46F_{0.95,2,8}=4.46, F0.95,1,9=5.12F_{0.95,1,9}=5.12) and note that the conclusions do not change with the values given.

Here n1=n2=10n_1=n_2=10 and p=2p=2.

(i) H0:μ1=(2.5,1)′H_0:\mu_1=(2.5,1)'. One-sample T2T^2 from sample 1. With x‾1−μ0=(0.5,0)′\bar x_1-\mu_0=(0.5,0)', |S1|=7|S_1|=7 and S1−1=17(2114)S_1^{-1}=\frac17\begin{pmatrix}2&1\\1&4\end{pmatrix}: T2=10×2(0.25)7=0.714,F=n1−p(n1−1)pT2=818(0.714)=0.317.T^2=10\times\frac{2(0.25)}7=0.714,\qquad F=\frac{n_1-p}{(n_1-1)p}T^2=\frac8{18}(0.714)=0.317 . 0.317<F0.95,2,8=4.460.317<F_{0.95,2,8}=4.46, so we do not reject H0H_0.

(ii) H0:μ1=μ2H_0:\mu_1=\mu_2 (assuming a common covariance matrix). The pooled matrix is Sp=9S1+9S218=(3−1.5−1.53),|Sp|=6.75,Sp−1=16.75(31.51.53).S_p=\frac{9S_1+9S_2}{18}=\begin{pmatrix}3&-1.5\\-1.5&3\end{pmatrix},\qquad|S_p|=6.75,\qquad S_p^{-1}=\frac1{6.75}\begin{pmatrix}3&1.5\\1.5&3\end{pmatrix}. x‾1−x‾2=(2,0)′\bar x_1-\bar x_2=(2,0)', so T2=n1n2n1+n2(x‾1−x‾2)′Sp−1(x‾1−x‾2)=5×3(4)6.75=8.889,T^2=\frac{n_1n_2}{n_1+n_2}(\bar x_1-\bar x_2)'S_p^{-1}(\bar x_1-\bar x_2)=5\times\frac{3(4)}{6.75}=8.889, F=n1+n2−p−1(n1+n2−2)pT2=1736(8.889)=4.198.F=\frac{n_1+n_2-p-1}{(n_1+n_2-2)p}T^2=\frac{17}{36}(8.889)=4.198 . 4.198>F0.95,2,17=3.594.198>F_{0.95,2,17}=3.59 (p≈0.033p\approx0.033), so we reject H0H_0: the two mean vectors differ, mainly in the first component.

(iii) H0:μ11+2μ12=4H_0:\mu_{11}+2\mu_{12}=4. This is a hypothesis about one linear combination a′μ1a'\mu_1 with a=(1,2)′a=(1,2)', so a univariate tt test applies. a′x‾1=3+2=5a'\bar x_1=3+2=5 and a′S1a=4−4+8=8a'S_1a=4-4+8=8: t=a′x‾1−4a′S1a/n1=10.8=1.118,t2=1.25.t=\frac{a'\bar x_1-4}{\sqrt{a'S_1a/n_1}}=\frac1{\sqrt{0.8}}=1.118,\qquad t^2=1.25 . t2=1.25<F0.95,1,9=5.12t^2=1.25<F_{0.95,1,9}=5.12 (and <4.38<4.38, the value supplied), so we do not reject H0H_0. Using the pooled matrix instead (a′Spa=9a'S_pa=9, 18 df) gives t2=1.11t^2=1.11, with the same conclusion.

✓ Checked by computer We checked in Python: (i) T² = 0.714 (F = 0.32); (ii) T² = 8.89, F = 4.20 > 3.59; (iii) t² = 1.25 with S₁ (1.11 with the pooled matrix). Each conclusion is the same under either choice of covariance estimate.

↑ Back to the question list

Show that Hotelling’s T2 is a generalization of the Student’s t. Prove the invariance property of T2 under the non-singular linear transformations of the variables. Briefly mention different uses of T2.

2018 · Paper I · Q8b · 15 marks

Solution

Generalisation of tt. For a univariate sample from N(μ,σ2)N(\mu,\sigma^2), Student’s statistic for H0:μ=μ0H_0:\mu=\mu_0 is t=N(x‾−μ0)s,t2=N(x‾−μ0)(s2)−1(x‾−μ0).t=\frac{\sqrt N(\bar x-\mu_0)}{s},\qquad t^2=N(\bar x-\mu_0)(s^2)^{-1}(\bar x-\mu_0). For a sample from Np(μ,Σ)N_p(\mu,\Sigma), Hotelling’s statistic is T2=N(x‾−μ0)′S−1(x‾−μ0).T^2=N(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0).

  • When p=1p=1, S=s2S=s^2 and T2=t2T^2=t^2; the result N−p(N−1)pT2∼Fp,N−p\frac{N-p}{(N-1)p}T^2\sim F_{p,N-p} becomes t2∼F1,N−1t^2\sim F_{1,N-1}.
  • For any fixed aa, the univariate tt for a′μ=a′μ0a'\mu=a'\mu_0 is ta=Na′(x‾−μ0)/a′Sat_a=\sqrt N\,a'(\bar x-\mu_0)/\sqrt{a'Sa}. By the Cauchy–Schwarz inequality, maxata2=maxaN{a′(x‾−μ0)}2a′Sa=N(x‾−μ0)′S−1(x‾−μ0)=T2,\max_a t_a^2=\max_a\frac{N\{a'(\bar x-\mu_0)\}^2}{a'Sa}=N(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0)=T^2, reached at a∝S−1(x‾−μ0)a\propto S^{-1}(\bar x-\mu_0). So T2T^2 is the largest squared tt over all linear combinations of the variables.

Invariance under non-singular linear transformations. Let yα=Cxα+dy_\alpha=Cx_\alpha+d with CC a non-singular p×pp\times p matrix. The hypothesis μx=μ0\mu_x=\mu_0 becomes μy=Cμ0+d\mu_y=C\mu_0+d. Then y‾=Cx‾+d,Sy=CSxC′,\bar y=C\bar x+d,\qquad S_y=CS_xC', so Ty2=N(y‾−Cμ0−d)′Sy−1(y‾−Cμ0−d)=N(x‾−μ0)′C′(C′)−1Sx−1C−1C(x‾−μ0)=Tx2.T_y^2=N(\bar y-C\mu_0-d)'S_y^{-1}(\bar y-C\mu_0-d)=N(\bar x-\mu_0)'C'(C')^{-1}S_x^{-1}C^{-1}C(\bar x-\mu_0)=T_x^2 . So T2T^2 does not change under a change of origin, a change of scale of any variable, or any non-singular linear combination of the variables. In particular the test does not depend on the units of measurement. ◼\blacksquare

Uses of T2T^2.

  1. Testing H0:μ=μ0H_0:\mu=\mu_0 for one multivariate normal population.
  2. Testing the equality of two mean vectors with a common covariance matrix: T2=n1n2n1+n2(x‾1−x‾2)′Sp−1(x‾1−x‾2)T^2=\frac{n_1n_2}{n_1+n_2}(\bar x_1-\bar x_2)'S_p^{-1}(\bar x_1-\bar x_2).
  3. Paired multivariate comparisons (applied to the differences).
  4. Testing a linear hypothesis Cμ=0C\mu=0, for example the equality of the components of μ\mu (profile analysis, repeated measures).
  5. Simultaneous confidence intervals for all linear combinations a′μa'\mu, and confidence ellipsoids for μ\mu.
  6. Testing the significance of Fisher’s discriminant function, via its relation T2=n1n2nD2T^2=\frac{n_1n_2}{n}D^2.
  7. Multivariate quality control charts.

✓ Proof checked step by step We checked the reduction of T² to t² for p = 1 and the invariance proof: under y = Cx + d both the mean deviation and S transform so that C cancels.

↑ Back to the question list

Suppose n1=11 and n2=12 observations are made on two random vectors X1 and X2 which are assumed to have bivariate normal distribution with a common covariance matrix Σ, but possibly different mean vectors μ1 and μ2. The sample mean vectors and pooled covariance matrix are X‾1=[−1−1],X‾2=[21],Spooled=[7−1−15] Obtain Mahalanobis sample distance D2 and Fisher’s linear discriminant function. Assign the observation X0′=(0,1) to either population π1 or π2.

2017 · Paper I · Q7b · 15 marks

Solution

Mahalanobis distance. X‾1−X‾2=(−3,−2)′\bar X_1-\bar X_2=(-3,-2)'. |Sp|=35−1=34|S_p|=35-1=34 and Sp−1=134(5117).S_p^{-1}=\frac1{34}\begin{pmatrix}5&1\\1&7\end{pmatrix}. a=Sp−1(X‾1−X‾2)=134(5(−3)+1(−2)1(−3)+7(−2))=134(−17−17)=(−0.5−0.5).a=S_p^{-1}(\bar X_1-\bar X_2)=\frac1{34}\begin{pmatrix}5(-3)+1(-2)\\1(-3)+7(-2)\end{pmatrix}=\frac1{34}\begin{pmatrix}-17\\-17\end{pmatrix}=\begin{pmatrix}-0.5\\-0.5\end{pmatrix}. D2=(X‾1−X‾2)′a=(−3)(−0.5)+(−2)(−0.5)=2.5.D^2=(\bar X_1-\bar X_2)'a=(-3)(-0.5)+(-2)(-0.5)=2.5 .

Fisher’s linear discriminant function. y=a′x=−0.5x1−0.5x2(equivalently y=−(x1+x2)/2).y=a'x=-0.5x_1-0.5x_2\qquad(\text{equivalently }y=-(x_1+x_2)/2). Scores of the means: y‾1=a′X‾1=1.0\bar y_1=a'\bar X_1=1.0 and y‾2=a′X‾2=−1.5\bar y_2=a'\bar X_2=-1.5; midpoint m=y‾1+y‾22=−0.25.m=\frac{\bar y_1+\bar y_2}2=-0.25 . Rule (equal priors and equal costs): allocate to π1\pi_1 if y≥my\ge m, otherwise to π2\pi_2.

Allocation of X0=(0,1)′X_0=(0,1)'. y0=−0.5(0)−0.5(1)=−0.5<−0.25y_0=-0.5(0)-0.5(1)=-0.5<-0.25, so X0X_0 is assigned to π2\pi_2.

(The separation is significant: T2=11×1223D2=14.35T^2=\frac{11\times12}{23}D^2=14.35, F=2042T2=6.83>F0.05(2,20)=3.49F=\frac{20}{42}T^2=6.83>F_{0.05}(2,20)=3.49.)

✓ Checked by computer We checked in Python: S⁻¹(x̄₁ − x̄₂) = (−0.5, −0.5), D² = 2.5, the midpoint is −0.25, and the score of x₀ is −0.5, so x₀ goes to π₂.

↑ Back to the question list

The data matrix for a random sample of size n=3 from a bivariate normal population BVN(μ1,μ2,σ12,σ22,ρ) is 𝐗=[61010683] Test the null hypothesis H0:𝛍=𝛍0 against H1:𝛍≠𝛍0, where 𝛍0′=(8,5), at 10% level of significance. [You are given: F0.10;2,1=49.5, F0.10;1,2=8.52632].

2016 · Paper I · Q5e · 10 marks

Solution

Sample mean and covariance. N=3N=3, p=2p=2. x‾=((6+10+8)/3(10+6+3)/3)=(819/3)=(86.333).\bar x=\begin{pmatrix}(6+10+8)/3\\(10+6+3)/3\end{pmatrix}=\begin{pmatrix}8\\19/3\end{pmatrix}=\begin{pmatrix}8\\6.333\end{pmatrix}. Deviations: (−2,11/3)(-2,\ 11/3), (2,−1/3)(2,\ -1/3), (0,−10/3)(0,\ -10/3). So ∑d12=8,∑d1d2=−223−23=−8,∑d22=121+1+1009=2229,\sum d_1^2=8,\qquad\sum d_1d_2=-\tfrac{22}3-\tfrac23=-8,\qquad\sum d_2^2=\tfrac{121+1+100}9=\tfrac{222}9, S=12(8−8−8222/9)=(4−4−412.333),|S|=49.333−16=33.333.S=\frac12\begin{pmatrix}8&-8\\-8&222/9\end{pmatrix}=\begin{pmatrix}4&-4\\-4&12.333\end{pmatrix},\qquad|S|=49.333-16=33.333 . S−1=133.333(12.333444).S^{-1}=\frac1{33.333}\begin{pmatrix}12.333&4\\4&4\end{pmatrix}.

T2T^2. With x‾−μ0=(0,4/3)′\bar x-\mu_0=(0,\ 4/3)': T2=3⋅4(4/3)233.333=3⋅7.11133.333=0.64.T^2=3\cdot\frac{4\,(4/3)^2}{33.333}=3\cdot\frac{7.111}{33.333}=0.64 .

Test. F=N−p(N−1)pT2=14(0.64)=0.16on (2,1) df.F=\frac{N-p}{(N-1)p}T^2=\frac14(0.64)=0.16\quad\text{on }(2,1)\text{ df}. 0.16<F0.10;2,1=49.50.16<F_{0.10;2,1}=49.5, so we do not reject H0:μ=(8,5)′H_0:\mu=(8,5)' at the 10% level. (The value F0.10;1,2F_{0.10;1,2} is not needed.)

✓ Checked by computer We checked in Python: x̄ = (8, 19/3), T² = 0.64 and F = 0.16 < 49.5.

↑ Back to the question list

If X1 and X2 be independent data matrices of order (n1×p) and (n2×p) respectively and if the ni rows of Xi(i=1,2) be identically and independently distributed as Np(μi,Σi), then for μ1=μ2 and Σ1=Σ2, show that n1n2nD2≃T2(p,n−2) variable, where n=n1+n2 D2 denotes sample Mahalanobis distance statistic.

2016 · Paper I · Q8b · 15 marks

Solution

Note. This is the same result as Q2; we give the proof with the notation of this question.

Set-up. Rows of XiX_i are iid Np(μi,Σi)N_p(\mu_i,\Sigma_i), i=1,2i=1,2, and we assume μ1=μ2=μ\mu_1=\mu_2=\mu and Σ1=Σ2=Σ\Sigma_1=\Sigma_2=\Sigma. Let Ai=Xi′Xi−nix‾ix‾i′=∑α(xiα−x‾i)(xiα−x‾i)′,S=A1+A2n−2,A_i=X_i'X_i-n_i\bar x_i\bar x_i'=\sum_\alpha(x_{i\alpha}-\bar x_i)(x_{i\alpha}-\bar x_i)',\qquad S=\frac{A_1+A_2}{n-2}, D2=(x‾1−x‾2)′S−1(x‾1−x‾2).D^2=(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2).

Step 1. x‾1−x‾2∼Np(0,(1n1+1n2)Σ)\bar x_1-\bar x_2\sim N_p\big(0,(\frac1{n_1}+\frac1{n_2})\Sigma\big), so Y=n1n2n(x‾1−x‾2)∼Np(0,Σ).Y=\sqrt{\frac{n_1n_2}{n}}(\bar x_1-\bar x_2)\sim N_p(0,\Sigma).

Step 2. Ai∼Wp(Σ,ni−1)A_i\sim W_p(\Sigma,n_i-1) independently, so A=A1+A2∼Wp(Σ,n−2)A=A_1+A_2\sim W_p(\Sigma,n-2).

Step 3. x‾i\bar x_i is independent of AiA_i for normal samples, and the samples are independent, so YY and AA are independent.

Step 4. By the definition of Hotelling’s T2T^2 (a Np(0,Σ)N_p(0,\Sigma) vector YY and an independent Wp(Σ,m)W_p(\Sigma,m) matrix AA give T2=mY′A−1Y∼T2(p,m)T^2=mY'A^{-1}Y\sim T^2(p,m)): n1n2nD2=Y′(An−2)−1Y=(n−2)Y′A−1Y∼T2(p,n−2).◼\frac{n_1n_2}{n}D^2=Y'\Big(\frac A{n-2}\Big)^{-1}Y=(n-2)Y'A^{-1}Y\sim T^2(p,n-2). \qquad\blacksquare

Hence n−p−1(n−2)p⋅n1n2nD2∼Fp,n−p−1\dfrac{n-p-1}{(n-2)p}\cdot\dfrac{n_1n_2}{n}D^2\sim F_{p,n-p-1}, which is the test of μ1=μ2\mu_1=\mu_2.

✓ Proof checked step by step We checked the proof, which uses the distribution of the difference of the means, the additivity of independent Wishart matrices and the independence of the mean and the sums of squares in normal samples.

↑ Back to the question list

A random sample of size 4 from a bivariate normal population provides the following statistics X¯=(46),S=(6−2−23) where X¯ is the sample mean and S is an unbiased estimator of the population dispersion matrix. Test the hypothesis H0:μ∼=(5,5)′ where μ is the population mean vector. (F.05,1,3=10.13,F.05,2,2=19.00,F.05,3,1=215.7)

2015 · Paper I · Q5a · 10 marks

Solution

Calculation. N=4N=4, p=2p=2, X‾−μ0=(4−5,6−5)′=(−1,1)′\bar X-\mu_0=(4-5,\ 6-5)'=(-1,1)'. |S|=18−4=14|S|=18-4=14, so S−1=114(3226).S^{-1}=\frac1{14}\begin{pmatrix}3&2\\2&6\end{pmatrix}. (X‾−μ0)′S−1(X‾−μ0)=114(3−2−2+6)=514,(\bar X-\mu_0)'S^{-1}(\bar X-\mu_0)=\frac1{14}(3-2-2+6)=\frac5{14}, T2=N×514=2014=1.429.T^2=N\times\frac5{14}=\frac{20}{14}=1.429 .

Test. F=N−p(N−1)pT2=26(1.429)=0.476on (2,2) df.F=\frac{N-p}{(N-1)p}T^2=\frac2{6}(1.429)=0.476\quad\text{on }(2,2)\text{ df}. Since 0.476<F0.05,2,2=19.000.476<F_{0.05,2,2}=19.00, we do not reject H0:μ=(5,5)′H_0:\mu=(5,5)' at the 5% level.

✓ Checked by computer We checked in Python: T² = 1.43, F = 0.476 < 19.

↑ Back to the question list

If π1 and π2 denote two bivariate normal populations where π1∼N2(μ1,Σ) and π2∼N2(μ2,Σ), μ′1=[10,15], μ2=[10,25] and Σ=(18121232). Compute the Mahalonobis distance between π1 and π2.

2014 · Paper I · Q5b · 10 marks

Solution

Definition. For two populations with a common dispersion matrix Σ\Sigma, the (squared) Mahalanobis distance is Δ2=(μ1−μ2)′Σ−1(μ1−μ2).\Delta^2=(\mu_1-\mu_2)'\Sigma^{-1}(\mu_1-\mu_2).

Calculation. μ1−μ2=(0,−10)′\mu_1-\mu_2=(0,-10)'. |Σ|=576−144=432|\Sigma|=576-144=432, and Σ−1=1432(32−12−1218).\Sigma^{-1}=\frac1{432}\begin{pmatrix}32&-12\\-12&18\end{pmatrix}. Δ2=(0,−10)(32−12−1218)(0−10)432=18×100432=4.167.\Delta^2=\frac{(0,-10)\begin{pmatrix}32&-12\\-12&18\end{pmatrix}\begin{pmatrix}0\\-10\end{pmatrix}}{432}=\frac{18\times100}{432}=4.167 . So Δ2=4.17\Delta^2=4.17 and Δ=2.04\Delta=2.04.

(The means differ only in the second character, by 10, whose variance is 32; ignoring the correlation would give 100/32=3.125100/32=3.125. The correlation with the first character, whose means are equal, increases the effective separation.)

✓ Checked by computer We checked in Python: (μ₁ − μ₂)′Σ⁻¹(μ₁ − μ₂) = 4.167.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Define Hotelling T2. State any one of its applications. A random sample of size 3 from a bivariate normal N2(μ_,Σ) distribution gave following unbiased estimates of μ_ and Σ x‾=(86),S=(4−3−39) Compute T2-statistic to test the hypothesis Ho:μ_=μ_o=(77).

2014 · Paper I · Q7b · 15 marks

Solution

Definition. For a random sample of size NN from Np(μ,Σ)N_p(\mu,\Sigma), with mean x‾\bar x and unbiased covariance matrix SS, Hotelling’s statistic for H0:μ=μ0H_0:\mu=\mu_0 is T2=N(x‾−μ0)′S−1(x‾−μ0),N−p(N−1)pT2∼Fp,N−punder H0.T^2=N(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0),\qquad\frac{N-p}{(N-1)p}T^2\sim F_{p,N-p}\ \text{under }H_0 .

One application. Testing whether two multivariate normal populations with a common covariance matrix have the same mean vector, with T2=n1n2n1+n2(x‾1−x‾2)′Sp−1(x‾1−x‾2)T^2=\frac{n_1n_2}{n_1+n_2}(\bar x_1-\bar x_2)'S_p^{-1}(\bar x_1-\bar x_2). Other uses are confidence regions for μ\mu and testing the significance of a discriminant function.

Calculation. N=3N=3, p=2p=2, x‾−μ0=(1,−1)′\bar x-\mu_0=(1,-1)'. |S|=36−9=27|S|=36-9=27 and S−1=127(9334).S^{-1}=\frac1{27}\begin{pmatrix}9&3\\3&4\end{pmatrix}. T2=3⋅9−3−3+427=3⋅727=79=0.778.T^2=3\cdot\frac{9-3-3+4}{27}=3\cdot\frac7{27}=\frac79=0.778 .

The corresponding F=14(0.778)=0.194F=\frac{1}{4}(0.778)=0.194 on (2,1)(2,1) df is far below F0.05(2,1)=199.5F_{0.05}(2,1)=199.5, so H0:μ=(7,7)′H_0:\mu=(7,7)' is not rejected.

✓ Checked by computer We checked in Python: T² = 7/9 = 0.778, F = 0.194.

↑ Back to the question list

Let X1…XN(N>p) be a random sample from Np(μ,Σ),Σ>0 where μ=(μ1…μp)′ and Σ are unknown. Show that for testing H0:μ1=μ2=…=μp against H1: not all μi’s are equal, the test statistic can be expressed as T=N[X‾′S‾′X‾−(X‾′S‾′ε)2ε′S‾′ε] where X‾ and S are the sample mean vector and the unbiased estimator of Σ respectively and ε=(1,1,…1)′. What would be the non null distribution of T?

2013 · Paper I · Q6b · 15 marks

Solution

Note on the question. In the printed formula “S‾′\bar S'” stands for S−1S^{-1}, the inverse of the unbiased estimator SS of Σ\Sigma. We show T=N[X‾′S−1X‾−(X‾′S−1ε)2ε′S−1ε].T=N\left[\bar X'S^{-1}\bar X-\frac{(\bar X'S^{-1}\varepsilon)^2}{\varepsilon'S^{-1}\varepsilon}\right].

Reduction to a T2T^2 problem. H0:μ1=…=μpH_0:\mu_1=\dots=\mu_p means Cμ=0C\mu=0, where CC is any (p−1)×p(p-1)\times p matrix of rank p−1p-1 with Cε=0C\varepsilon=0 (for example rows (1,−1,0,…)(1,-1,0,\dots), (0,1,−1,…)(0,1,-1,\dots), …). Then CXα∼Np−1(Cμ,CΣC′)CX_\alpha\sim N_{p-1}(C\mu,C\Sigma C'), and the T2T^2 statistic for H0:Cμ=0H_0:C\mu=0 is T=NX‾′C′(CSC′)−1CX‾.T=N\,\bar X'C'(CSC')^{-1}C\bar X . It does not depend on which CC is chosen: any other choice is C1=LCC_1=LC with LL non-singular, and LL cancels.

Algebraic form. Let S1/2S^{1/2} be a square root of SS and put u=S−1/2X‾u=S^{-1/2}\bar X, v=S−1/2εv=S^{-1/2}\varepsilon, W=CS1/2W=CS^{1/2}. Then C′(CSC′)−1C=S−1/2W′(WW′)−1WS−1/2.C'(CSC')^{-1}C=S^{-1/2}\,W'(WW')^{-1}W\,S^{-1/2}. P=W′(WW′)−1WP=W'(WW')^{-1}W is the projection onto the row space of WW. Since Wv=Cε=0Wv=C\varepsilon=0 and WW has rank p−1p-1, that space is the orthogonal complement of vv. Hence P=I−vv′v′v.P=I-\frac{vv'}{v'v}. Therefore T=Nu′Pu=N[u′u−(u′v)2v′v]=N[X‾′S−1X‾−(X‾′S−1ε)2ε′S−1ε].◼T=N\,u'Pu=N\Big[u'u-\frac{(u'v)^2}{v'v}\Big]=N\Big[\bar X'S^{-1}\bar X-\frac{(\bar X'S^{-1}\varepsilon)^2}{\varepsilon'S^{-1}\varepsilon}\Big]. \qquad\blacksquare

Null distribution. CX‾∼Np−1(Cμ,CΣC′/N)C\bar X\sim N_{p-1}(C\mu,C\Sigma C'/N) and (N−1)CSC′∼Wp−1(CΣC′,N−1)(N-1)CSC'\sim W_{p-1}(C\Sigma C',N-1), independently. So T∼T2(p−1,N−1)T\sim T^2(p-1,N-1) and N−p+1(N−1)(p−1)T∼Fp−1,N−p+1under H0.\frac{N-p+1}{(N-1)(p-1)}\,T\sim F_{p-1,\,N-p+1}\quad\text{under }H_0 .

Non-null distribution. When the μi\mu_i are not all equal, the same ratio has the non-central FF distribution N−p+1(N−1)(p−1)T∼F′p−1,N−p+1(λ),λ=Nμ′C′(CΣC′)−1Cμ=N[μ′Σ−1μ−(μ′Σ−1ε)2ε′Σ−1ε].\frac{N-p+1}{(N-1)(p-1)}\,T\sim F'_{p-1,\,N-p+1}(\lambda),\qquad\lambda=N\,\mu'C'(C\Sigma C')^{-1}C\mu=N\Big[\mu'\Sigma^{-1}\mu-\frac{(\mu'\Sigma^{-1}\varepsilon)^2}{\varepsilon'\Sigma^{-1}\varepsilon}\Big]. The non-centrality λ\lambda is zero exactly when μ\mu is a multiple of ε\varepsilon, that is, under H0H_0.

✓ Derivation checked step by step Every step was checked: the reduction to a T² test for the contrast vector Cμ = 0, its expression through S⁻¹ and ε, and the non-central F distribution.

↑ Back to the question list

Define Mahalanobis measure of distance squared between two populations with a common positive definite dispersion matrix and show that it is a non decreasing function of the number of characteristics.

2013 · Paper I · Q7b · 15 marks

Solution

Definition. For populations π1:Np(μ1,Σ)\pi_1:N_p(\mu_1,\Sigma) and π2:Np(μ2,Σ)\pi_2:N_p(\mu_2,\Sigma) with a common positive definite Σ\Sigma, the squared Mahalanobis distance is Δp2=δ′Σ−1δ,δ=μ1−μ2.\Delta_p^2=\delta'\Sigma^{-1}\delta,\qquad\delta=\mu_1-\mu_2 . It measures the separation of the means in units that allow for the variances and correlations of the characters. It is invariant under non-singular linear transformations, and equals (μ1−μ2)2/σ2(\mu_1-\mu_2)^2/\sigma^2 when p=1p=1.

Claim. If more characters are added, Δ2\Delta^2 cannot decrease.

Proof. Suppose we add qq characters to the original pp. Partition δ=(δ1δ2),Σ=(Σ11Σ12Σ21Σ22),\delta=\begin{pmatrix}\delta_1\\\delta_2\end{pmatrix},\qquad\Sigma=\begin{pmatrix}\Sigma_{11}&\Sigma_{12}\\\Sigma_{21}&\Sigma_{22}\end{pmatrix}, with δ1,Σ11\delta_1,\Sigma_{11} belonging to the first pp characters. Write Σ22⋅1=Σ22−Σ21Σ11−1Σ12\Sigma_{22\cdot1}=\Sigma_{22}-\Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12}, which is positive definite. The partitioned inverse gives Σ−1=(Σ11−1000)+(−Σ11−1Σ12I)Σ22⋅1−1(−Σ21Σ11−1I).\Sigma^{-1}=\begin{pmatrix}\Sigma_{11}^{-1}&0\\0&0\end{pmatrix}+\begin{pmatrix}-\Sigma_{11}^{-1}\Sigma_{12}\\I\end{pmatrix}\Sigma_{22\cdot1}^{-1}\begin{pmatrix}-\Sigma_{21}\Sigma_{11}^{-1}&I\end{pmatrix}. Hence Δp+q2=δ′Σ−1δ=δ1′Σ11−1δ1+(δ2−Σ21Σ11−1δ1)′Σ22⋅1−1(δ2−Σ21Σ11−1δ1).\Delta^2_{p+q}=\delta'\Sigma^{-1}\delta=\delta_1'\Sigma_{11}^{-1}\delta_1+(\delta_2-\Sigma_{21}\Sigma_{11}^{-1}\delta_1)'\,\Sigma_{22\cdot1}^{-1}\,(\delta_2-\Sigma_{21}\Sigma_{11}^{-1}\delta_1). The first term is Δp2\Delta_p^2. The second is a positive definite quadratic form, so it is ≥0\ge0. Therefore Δp+q2≥Δp2,\Delta^2_{p+q}\ \ge\ \Delta^2_p, with equality if and only if δ2=Σ21Σ11−1δ1\delta_2=\Sigma_{21}\Sigma_{11}^{-1}\delta_1. ◼\blacksquare

Interpretation. δ2−Σ21Σ11−1δ1\delta_2-\Sigma_{21}\Sigma_{11}^{-1}\delta_1 is the difference in the means of the new characters after allowing for their regression on the old ones. A new character adds nothing to the distance only when its mean difference is fully predicted by the characters already used. This is also why, in practice, one tests whether added characters contribute significantly rather than simply adding characters (with estimated D2D^2, a useless character can still raise D2D^2 by chance).

✓ Proof checked step by step We checked the proof, and checked numerically for a 3-variable example that Δ² increases from 0.50 to 0.53 to 0.62 as characters are added.

↑ Back to the question list

Bring out the relation between Hotelling’s T2 and Mahalanobis D2. Explain how T2 can be interpreted as an extension of the student’s t statistic. Describe the utility of Fisher’s discriminent function in classification problems.

2012 · Paper I · Q7b · 20 marks

Solution

Relation between T2T^2 and D2D^2. For samples of sizes n1,n2n_1,n_2 from Np(μ1,Σ)N_p(\mu_1,\Sigma) and Np(μ2,Σ)N_p(\mu_2,\Sigma), the sample Mahalanobis distance is D2=(x‾1−x‾2)′S−1(x‾1−x‾2),D^2=(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2), with SS the pooled unbiased covariance matrix. The two-sample Hotelling statistic for H0:μ1=μ2H_0:\mu_1=\mu_2 is T2=n1n2n1+n2D2,n1+n2−p−1(n1+n2−2)pT2∼Fp,n1+n2−p−1under H0.T^2=\frac{n_1n_2}{n_1+n_2}\,D^2,\qquad\frac{n_1+n_2-p-1}{(n_1+n_2-2)p}T^2\sim F_{p,\,n_1+n_2-p-1}\ \text{under }H_0 . So D2D^2 measures the distance between the samples, and T2T^2 turns it into a test statistic by allowing for the sample sizes. (In the one-sample case, T2=ND2T^2=N\,D^2 with D2=(x‾−μ0)′S−1(x‾−μ0)D^2=(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0).)

T2T^2 as an extension of Student’s tt.

  • With one variable, the two-sample tt is t=x‾1−x‾2s1/n1+1/n2t=\dfrac{\bar x_1-\bar x_2}{s\sqrt{1/n_1+1/n_2}}, so t2=n1n2n1+n2(x‾1−x‾2)(s2)−1(x‾1−x‾2)t^2=\dfrac{n_1n_2}{n_1+n_2}(\bar x_1-\bar x_2)(s^2)^{-1}(\bar x_1-\bar x_2). T2T^2 has exactly this form, with vectors and matrices in place of scalars. For p=1p=1 it reduces to t2t^2, and its FF distribution reduces to t2∼F1,n1+n2−2t^2\sim F_{1,n_1+n_2-2}.
  • T2T^2 is the maximum of the squared tt statistics over all linear combinations a′xa'x of the variables. So it tests all such comparisons at once while controlling the overall level.
  • Like tt, it is the likelihood ratio test and is invariant under changes of scale (indeed, under any non-singular linear transformation).

Fisher’s discriminant function in classification. Fisher looked for the linear combination y=a′xy=a'x that separates the two groups best, in the sense of maximising {a′(x‾1−x‾2)}2a′Sa.\frac{\{a'(\bar x_1-\bar x_2)\}^2}{a'Sa}. The maximum is reached at a=S−1(x‾1−x‾2),a=S^{-1}(\bar x_1-\bar x_2), and its maximum value is D2D^2. To classify a new individual x0x_0:

  • compute y0=a′x0y_0=a'x_0 and the midpoint m=12a′(x‾1+x‾2)m=\frac12a'(\bar x_1+\bar x_2);
  • assign x0x_0 to π1\pi_1 if y0≥my_0\ge m and to π2\pi_2 otherwise (with unequal priors qiq_i or costs, compare with m+log(q2/q1)m+\log(q_2/q_1) instead).

For normal populations with a common covariance matrix this is the optimal (Bayes) rule. Its expected error rate is Φ(−Δ/2)\Phi(-\Delta/2), so a larger Mahalanobis distance means better classification. It also reduces pp measurements to a single score, and shows (through the size of the coefficients for standardised variables) which characters matter most. Uses include taxonomy, medical diagnosis, credit scoring and anthropometric classification.

✓ Answer checked step by step Every step was checked: the relation T² = n₁n₂D²/(n₁ + n₂), the reduction of T² to Student’s t when p = 1, and the discriminant rule.

↑ Back to the question list

In order to test the equality of mean vectors of Np(μi,Σ)i=1,2 define Hotelling’s T2-statistic and sketch the derivation of its null distribution.

2005 · Paper I · Q6c · 20 marks

Solution

Statistic. Samples of sizes n1,n2n_1,n_2 from Np(μ1,Σ)N_p(\mu_1,\Sigma) and Np(μ2,Σ)N_p(\mu_2,\Sigma). Let x‾1,x‾2\bar x_1,\bar x_2 be the means, AiA_i the matrices of sums of squares and products, and S=A1+A2n1+n2−2.S=\frac{A_1+A_2}{n_1+n_2-2}. To test H0:μ1=μ2H_0:\mu_1=\mu_2, T2=n1n2n1+n2(x‾1−x‾2)′S−1(x‾1−x‾2).T^2=\frac{n_1n_2}{n_1+n_2}(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2).

Null distribution: sketch. Write m=n1+n2−2m=n_1+n_2-2.

Step 1. Under H0H_0, Y=n1n2n1+n2(x‾1−x‾2)∼Np(0,Σ)Y=\sqrt{\frac{n_1n_2}{n_1+n_2}}(\bar x_1-\bar x_2)\sim N_p(0,\Sigma), and A=A1+A2∼Wp(Σ,m)A=A_1+A_2\sim W_p(\Sigma,m), independent of YY. So T2=mY′A−1YT^2=m\,Y'A^{-1}Y.

Step 2 (reduce to the identity). T2T^2 is invariant under Y→Σ−1/2YY\to\Sigma^{-1/2}Y, A→Σ−1/2AΣ−1/2A\to\Sigma^{-1/2}A\Sigma^{-1/2}, so we may take Σ=I\Sigma=I.

Step 3 (condition on YY). Given Y=yY=y, choose an orthogonal matrix QQ with first row y′/∥y∥y'/\|y\|. Then B=QAQ′∼Wp(I,m)B=QAQ'\sim W_p(I,m), still independent of YY, and Y′A−1Y=∥y∥2(B−1)11=∥y∥2b11⋅2,Y'A^{-1}Y=\|y\|^2\,(B^{-1})_{11}=\frac{\|y\|^2}{b_{11\cdot2}}, where b11⋅2=b11−b12B22−1b21b_{11\cdot2}=b_{11}-b_{12}B_{22}^{-1}b_{21} is the residual of b11b_{11} after regression on the other p−1p-1 coordinates.

Step 4 (two independent chi-squares). A standard property of the Wishart distribution is that b11⋅2∼χm−p+12b_{11\cdot2}\sim\chi^2_{m-p+1}, whatever yy is, so it is independent of YY. Also ∥Y∥2=Y′Y∼χp2\|Y\|^2=Y'Y\sim\chi^2_p.

Step 5. Hence T2m=χp2χm−p+12(independent),m−p+1mpT2∼Fp,m−p+1.\frac{T^2}m=\frac{\chi^2_p}{\chi^2_{m-p+1}}\quad\text{(independent)},\qquad\frac{m-p+1}{mp}T^2\sim F_{p,\,m-p+1}. With m=n1+n2−2m=n_1+n_2-2: n1+n2−p−1(n1+n2−2)pT2∼Fp,n1+n2−p−1under H0.\frac{n_1+n_2-p-1}{(n_1+n_2-2)p}\,T^2\sim F_{p,\,n_1+n_2-p-1}\quad\text{under }H_0 .

We reject H0H_0 at level α\alpha when this FF exceeds Fα(p,n1+n2−p−1)F_\alpha(p,n_1+n_2-p-1). Under H1H_1 the same ratio has a non-central FF distribution with non-centrality n1n2n1+n2Δ2\frac{n_1n_2}{n_1+n_2}\Delta^2, where Δ2=(μ1−μ2)′Σ−1(μ1−μ2)\Delta^2=(\mu_1-\mu_2)'\Sigma^{-1}(\mu_1-\mu_2).

✓ Derivation checked step by step Every step was checked: the definition of the two-sample T², the normal and Wishart components, their independence, and the route from T² to the F distribution.

↑ Back to the question list

Define Mahalanobis D2. Show that it is invariant under any non-singular linear transformation.

2002 · Paper I · Q5f · 12 marks

Solution

Definition. For two populations with means μ1,μ2\mu_1,\mu_2 and common dispersion matrix Σ\Sigma, the Mahalanobis distance is Δ2=(μ1−μ2)′Σ−1(μ1−μ2).\Delta^2=(\mu_1-\mu_2)'\Sigma^{-1}(\mu_1-\mu_2). Its sample version, from samples of sizes n1,n2n_1,n_2, is D2=(x‾1−x‾2)′S−1(x‾1−x‾2),D^2=(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2), with SS the pooled unbiased covariance matrix. It generalises (x‾1−x‾2)2/s2(\bar x_1-\bar x_2)^2/s^2 to pp characters, allowing for their different variances and their correlations.

Invariance. Let y=Cx+dy=Cx+d, with CC a non-singular p×pp\times p matrix, applied to every observation in both samples. Then y‾1−y‾2=C(x‾1−x‾2),Sy=CSxC′.\bar y_1-\bar y_2=C(\bar x_1-\bar x_2),\qquad S_y=CS_xC'. So Dy2=(x‾1−x‾2)′C′(CSxC′)−1C(x‾1−x‾2)=(x‾1−x‾2)′C′(C′)−1Sx−1C−1C(x‾1−x‾2)=Dx2.D_y^2=(\bar x_1-\bar x_2)'C'(CS_xC')^{-1}C(\bar x_1-\bar x_2)=(\bar x_1-\bar x_2)'C'(C')^{-1}S_x^{-1}C^{-1}C(\bar x_1-\bar x_2)=D_x^2 . The same algebra applies to Δ2\Delta^2, with Σy=CΣC′\Sigma_y=C\Sigma C'. ◼\blacksquare

Consequences. D2D^2 does not depend on the units of measurement (kg or g, cm or inch), on the origin, or on which non-singular linear combinations of the characters are used. Euclidean distance has none of these properties.

✓ Proof checked step by step We checked the proof: under y = Cx + d the mean difference becomes C(x̄₁ − x̄₂) and the covariance matrix becomes CSC′, so C cancels.

↑ Back to the question list

Let X∼Np(μ,Σ) unknown and μ=(μ1,μ2,…,μp)′. Suggest a test for H0:μ1=μ2=…μp against H1: all μ s are not equal.

2000 · Paper I · Q6b(ii) · 15 marks

Solution

Idea. H0:μ1=μ2=…=μpH_0:\mu_1=\mu_2=\dots=\mu_p is the hypothesis Cμ=0C\mu=0 for a (p−1)×p(p-1)\times p contrast matrix CC, for example C=(1−10⋯001−1⋯0⋮⋱⋱⋮0⋯01−1).C=\begin{pmatrix}1&-1&0&\cdots&0\\0&1&-1&\cdots&0\\\vdots&&\ddots&\ddots&\vdots\\0&\cdots&0&1&-1\end{pmatrix}. So we transform each observation to the p−1p-1 differences yα=Cxαy_\alpha=Cx_\alpha and test whether their mean vector is zero.

Test. With a sample x1,…,xNx_1,\dots,x_N (N>pN>p), mean x‾\bar x and unbiased covariance matrix SS:

  • yα=Cxα∼Np−1(Cμ,CΣC′)y_\alpha=Cx_\alpha\sim N_{p-1}(C\mu,C\Sigma C'), with mean Cx‾C\bar x and covariance CSC′CSC'.
  • The Hotelling statistic is T2=N(Cx‾)′(CSC′)−1(Cx‾).T^2=N(C\bar x)'(CSC')^{-1}(C\bar x).
  • Under H0H_0, F=N−p+1(N−1)(p−1)T2∼Fp−1,N−p+1.F=\frac{N-p+1}{(N-1)(p-1)}\,T^2\sim F_{p-1,\,N-p+1}.
  • Reject H0H_0 at level α\alpha if F>Fα(p−1,N−p+1)F>F_\alpha(p-1,N-p+1).

Remarks.

  • The statistic does not depend on which contrast matrix is used, as long as its rows span the contrasts; it can also be written as T2=N[x‾′S−1x‾−(x‾′S−1𝟏)2/(𝟏′S−1𝟏)]T^2=N[\bar x'S^{-1}\bar x-(\bar x'S^{-1}\mathbf 1)^2/(\mathbf 1'S^{-1}\mathbf 1)] (see Q14).
  • This is the likelihood ratio test of H0H_0, and it makes no assumption about the form of Σ\Sigma. (If Σ\Sigma has the special “compound symmetric” form, the ordinary repeated-measures ANOVA FF can be used instead.)
  • A typical use is repeated measurements on the same individuals, such as the same test given at pp times, or pp treatments on each subject (profile analysis).

✓ Derivation checked step by step Every step was checked: the contrast transformation, the T² statistic on p − 1 variables and its F distribution.

↑ Back to the question list

Define Hotelling’s T2. Show that it is invariant under non-singular linear transformations. Mention some uses of the T2 statistic.

1999 · Paper I · Q12b · 25 marks

Solution

Definition. For a random sample x1,…,xNx_1,\dots,x_N from Np(μ,Σ)N_p(\mu,\Sigma) with x‾\bar x and unbiased SS, Hotelling’s T2T^2 for H0:μ=μ0H_0:\mu=\mu_0 is T2=N(x‾−μ0)′S−1(x‾−μ0).T^2=N(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0). More generally, if Y∼Np(0,Σ)Y\sim N_p(0,\Sigma) and A∼Wp(Σ,m)A\sim W_p(\Sigma,m) independently, T2=mY′A−1YT^2=mY'A^{-1}Y is said to have Hotelling’s T2(p,m)T^2(p,m) distribution, and m−p+1mpT2∼Fp,m−p+1\frac{m-p+1}{mp}T^2\sim F_{p,m-p+1}.

Invariance. Let yα=Cxα+dy_\alpha=Cx_\alpha+d with |C|≠0|C|\ne0. The null hypothesis becomes μy=Cμ0+d\mu_y=C\mu_0+d, and y‾−(Cμ0+d)=C(x‾−μ0),Sy=CSxC′.\bar y-(C\mu_0+d)=C(\bar x-\mu_0),\qquad S_y=CS_xC'. Hence Ty2=N(x‾−μ0)′C′(C′)−1Sx−1C−1C(x‾−μ0)=N(x‾−μ0)′Sx−1(x‾−μ0)=Tx2.T_y^2=N(\bar x-\mu_0)'C'(C')^{-1}S_x^{-1}C^{-1}C(\bar x-\mu_0)=N(\bar x-\mu_0)'S_x^{-1}(\bar x-\mu_0)=T_x^2 . So T2T^2 is unchanged by any non-singular linear transformation (including changes of origin and of scale). Its distribution under H1H_1 depends on μ\mu and Σ\Sigma only through Δ2=(μ−μ0)′Σ−1(μ−μ0)\Delta^2=(\mu-\mu_0)'\Sigma^{-1}(\mu-\mu_0), which is invariant too. ◼\blacksquare

Uses of T2T^2.

  1. Test of a specified mean vector, H0:μ=μ0H_0:\mu=\mu_0.
  2. Test of equality of two mean vectors (common Σ\Sigma): T2=n1n2n1+n2D2T^2=\frac{n_1n_2}{n_1+n_2}D^2.
  3. Paired comparisons of multivariate observations.
  4. Tests of linear hypotheses Cμ=0C\mu=0, such as equal means of the pp components or parallel profiles.
  5. Confidence ellipsoids for μ\mu and simultaneous confidence intervals for all a′μa'\mu.
  6. Testing the significance of a discriminant function and of the Mahalanobis D2D^2.
  7. Multivariate control charts in quality control.

✓ Proof checked step by step We checked the invariance proof: under y = Cx + d the mean deviation becomes C(x̄ − μ₀) and S becomes CSC′, and C cancels.

↑ Back to the question list

T2 statistics is the generalization of t-statistic. Explain its relationship with D2-statistic. Explain the uses of T2 statistic in test of hypothesis.

1998 · Paper I · Q12a · 30 marks

Solution

T2T^2 as a generalisation of tt. Student’s tt for one variable, t=N(x‾−μ0)/st=\sqrt N(\bar x-\mu_0)/s, satisfies t2=N(x‾−μ0)(s2)−1(x‾−μ0).t^2=N(\bar x-\mu_0)(s^2)^{-1}(\bar x-\mu_0). Hotelling’s statistic for pp variables, T2=N(x‾−μ0)′S−1(x‾−μ0),T^2=N(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0), has the same form with the mean vector and covariance matrix in place of the scalars. For p=1p=1 they coincide. T2T^2 is also the largest t2t^2 over all linear combinations a′xa'x, and N−p(N−1)pT2∼Fp,N−p\frac{N-p}{(N-1)p}T^2\sim F_{p,N-p} just as t2∼F1,N−1t^2\sim F_{1,N-1}.

Relationship with D2D^2. The sample Mahalanobis distance between two samples is D2=(x‾1−x‾2)′S−1(x‾1−x‾2)D^2=(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2), with SS the pooled covariance matrix. The two-sample T2T^2 is T2=n1n2n1+n2D2.T^2=\frac{n_1n_2}{n_1+n_2}D^2 . So D2D^2 is a descriptive measure of how far apart two groups are, and T2T^2 is the test statistic built from it. Under H0:μ1=μ2H_0:\mu_1=\mu_2, n1+n2−p−1(n1+n2−2)p⋅n1n2n1+n2D2∼Fp,n1+n2−p−1.\frac{n_1+n_2-p-1}{(n_1+n_2-2)p}\cdot\frac{n_1n_2}{n_1+n_2}D^2\sim F_{p,n_1+n_2-p-1}.

Uses of T2T^2 in testing hypotheses.

  1. One sample: H0:μ=μ0H_0:\mu=\mu_0, with F=N−p(N−1)pT2F=\frac{N-p}{(N-1)p}T^2 on (p,N−p)(p,N-p) df.
  2. Two samples: H0:μ1=μ2H_0:\mu_1=\mu_2 with a common Σ\Sigma, as above.
  3. Paired samples: apply the one-sample test to the vector differences.
  4. Equality of components: H0:μ1=…=μpH_0:\mu_1=\dots=\mu_p through contrasts, T2=N(Cx‾)′(CSC′)−1Cx‾T^2=N(C\bar x)'(CSC')^{-1}C\bar x on (p−1,N−p+1)(p-1,N-p+1) df.
  5. Significance of a discriminant function, and of the gain from extra characters in D2D^2.
  6. Confidence regions: the ellipsoid {μ:N(x‾−μ)′S−1(x‾−μ)≤Tα2}\{\mu:N(\bar x-\mu)'S^{-1}(\bar x-\mu)\le T^2_\alpha\} and simultaneous intervals for all a′μa'\mu.

✓ Answer checked step by step Every step was checked: the reduction of T² to t² for one variable, the relation T² = n₁n₂D²/(n₁ + n₂), and the tests listed.

↑ Back to the question list

Let Xα(α=1,2,…,N) be a random sample of size N from Np(μ,Σ), where Σ is known. Develop a suitable test for testing the null hypothesis H0:μ=μ0, where μ0 is a given vector.

1997 · Paper I · Q12a · 30 marks

Solution

Set-up. X1,…,XNX_1,\dots,X_N are iid Np(μ,Σ)N_p(\mu,\Sigma) with Σ\Sigma known. We test H0:μ=μ0H_0:\mu=\mu_0 against H1:μ≠μ0H_1:\mu\ne\mu_0.

Sufficient statistic. X‾∼Np(μ,Σ/N)\bar X\sim N_p(\mu,\Sigma/N) is sufficient for μ\mu.

Likelihood ratio test. L(μ)∝exp{−12∑α(xα−μ)′Σ−1(xα−μ)}=exp{−12∑α(xα−x‾)′Σ−1(xα−x‾)−N2(x‾−μ)′Σ−1(x‾−μ)}.L(\mu)\propto\exp\Big\{-\frac12\sum_\alpha(x_\alpha-\mu)'\Sigma^{-1}(x_\alpha-\mu)\Big\}=\exp\Big\{-\frac12\sum_\alpha(x_\alpha-\bar x)'\Sigma^{-1}(x_\alpha-\bar x)-\frac N2(\bar x-\mu)'\Sigma^{-1}(\bar x-\mu)\Big\}. The unrestricted maximum is at μ̂=x‾\hat\mu=\bar x, where the last term is zero. So λ=L(μ0)L(x‾)=exp{−N2(x‾−μ0)′Σ−1(x‾−μ0)},\lambda=\frac{L(\mu_0)}{L(\bar x)}=\exp\Big\{-\frac N2(\bar x-\mu_0)'\Sigma^{-1}(\bar x-\mu_0)\Big\}, and −2logλ-2\log\lambda is the statistic χ2=N(X‾−μ0)′Σ−1(X‾−μ0).\chi^2=N(\bar X-\mu_0)'\Sigma^{-1}(\bar X-\mu_0). Small λ\lambda means large χ2\chi^2.

Distribution. Let Z=NΣ−1/2(X‾−μ0)Z=\sqrt N\,\Sigma^{-1/2}(\bar X-\mu_0). Under H0H_0, Z∼Np(0,I)Z\sim N_p(0,I), so χ2=Z′Z∼χp2exactly.\chi^2=Z'Z\sim\chi^2_p\quad\text{exactly}.

Test. Reject H0H_0 at level α\alpha if N(x‾−μ0)′Σ−1(x‾−μ0)>χp,α2.N(\bar x-\mu_0)'\Sigma^{-1}(\bar x-\mu_0)>\chi^2_{p,\alpha}.

Power. Under H1H_1, Z∼Np(NΣ−1/2(μ−μ0),I)Z\sim N_p(\sqrt N\Sigma^{-1/2}(\mu-\mu_0),I), so χ2\chi^2 has a non-central chi-square distribution with pp df and non-centrality λ=N(μ−μ0)′Σ−1(μ−μ0)=NΔ2.\lambda=N(\mu-\mu_0)'\Sigma^{-1}(\mu-\mu_0)=N\Delta^2 . The power increases with NN and with the Mahalanobis distance of μ\mu from μ0\mu_0.

Remarks.

  • For p=1p=1 this is the usual zz test, N(x‾−μ0)2/σ2∼χ12N(\bar x-\mu_0)^2/\sigma^2\sim\chi^2_1.
  • The acceptance region is the ellipsoid {μ0:N(x‾−μ0)′Σ−1(x‾−μ0)≤χp,α2}\{\mu_0:N(\bar x-\mu_0)'\Sigma^{-1}(\bar x-\mu_0)\le\chi^2_{p,\alpha}\}, a 100(1−α)%100(1-\alpha)\% confidence region for μ\mu.
  • It is better than pp separate zz tests, because it allows for the correlations and keeps the overall level at α\alpha.
  • When Σ\Sigma is unknown, Σ\Sigma is replaced by SS and the test becomes Hotelling’s T2T^2.

✓ Derivation checked step by step Every step was checked: the distribution of N(x̄ − μ₀)′Σ⁻¹(x̄ − μ₀), its derivation as the likelihood ratio test, and the non-central chi-square power function.

↑ Back to the question list

Define Mahalanobis’ distance between two populations as estimated from the sample on the basis of p characters. State how the D2-statistic is used to test the hypothesis of no difference in mean values of the p characters.

1996 · Paper I · Q12a · 30 marks

Solution

Population distance. For populations with mean vectors μ1,μ2\mu_1,\mu_2 and a common dispersion matrix Σ\Sigma, Mahalanobis’ distance on pp characters is Δp2=(μ1−μ2)′Σ−1(μ1−μ2)=∑i∑jσijδiδj,δi=μ1i−μ2i.\Delta_p^2=(\mu_1-\mu_2)'\Sigma^{-1}(\mu_1-\mu_2)=\sum_i\sum_j\sigma^{ij}\delta_i\delta_j,\qquad\delta_i=\mu_{1i}-\mu_{2i}.

Sample estimate. From independent samples of sizes n1,n2n_1,n_2 with means x‾1,x‾2\bar x_1,\bar x_2 and pooled within-sample covariance matrix S=A1+A2n1+n2−2=(sij),S=\frac{A_1+A_2}{n_1+n_2-2}=(s_{ij}), the estimated distance is Dp2=(x‾1−x‾2)′S−1(x‾1−x‾2)=∑i∑jsijdidj,di=x‾1i−x‾2i.D_p^2=(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2)=\sum_i\sum_js^{ij}d_id_j,\qquad d_i=\bar x_{1i}-\bar x_{2i}. (Mahalanobis used it to measure the distance between Indian caste groups from anthropometric characters. D2D^2 overestimates Δ2\Delta^2 on average: E(D2)=n−2n−p−3(Δ2+pnn1n2)E(D^2)=\frac{n-2}{n-p-3}\big(\Delta^2+\frac{p\,n}{n_1n_2}\big), with n=n1+n2n=n_1+n_2.)

Test of no difference in the mean values. To test H0:μ1=μ2H_0:\mu_1=\mu_2, i.e. Δ2=0\Delta^2=0: F=n1+n2−p−1(n1+n2−2)p⋅n1n2n1+n2Dp2∼Fp,n1+n2−p−1under H0.F=\frac{n_1+n_2-p-1}{(n_1+n_2-2)\,p}\cdot\frac{n_1n_2}{n_1+n_2}\,D_p^2\sim F_{p,\,n_1+n_2-p-1}\quad\text{under }H_0 . This follows because n1n2n1+n2D2\frac{n_1n_2}{n_1+n_2}D^2 is Hotelling’s two-sample T2T^2. We reject H0H_0 at level α\alpha when F>Fα(p,n1+n2−p−1)F>F_\alpha(p,n_1+n_2-p-1).

Testing extra characters. To test whether qq further characters add to the separation given by the first pp: F=n1+n2−p−q−1q⋅n1n2n(Dp+q2−Dp2)(n−2)+n1n2nDp2∼Fq,n−p−q−1.F=\frac{n_1+n_2-p-q-1}{q}\cdot\frac{\frac{n_1n_2}{n}(D^2_{p+q}-D^2_p)}{(n-2)+\frac{n_1n_2}nD^2_p}\sim F_{q,\,n-p-q-1}.

✓ Derivation checked step by step Every step was checked: the definition of D² from two samples and the F test of no difference in the mean values of the p characters.

↑ Back to the question list

Define Hotelling’s T2 statistic and Mahalanobis’ D2 statistic and state the relationship between the two. Describe the various uses of these statistics in test of hypotheses.

1995 · Paper I · Q12a · 30 marks

Solution

Hotelling’s T2T^2. If Y∼Np(ν,Σ)Y\sim N_p(\nu,\Sigma) and A∼Wp(Σ,m)A\sim W_p(\Sigma,m) independently, T2=mY′A−1YT^2=mY'A^{-1}Y. In practice, for a sample of size NN from Np(μ,Σ)N_p(\mu,\Sigma), T2=N(x‾−μ0)′S−1(x‾−μ0),N−p(N−1)pT2∼Fp,N−punder H0:μ=μ0.T^2=N(\bar x-\mu_0)'S^{-1}(\bar x-\mu_0),\qquad\frac{N-p}{(N-1)p}T^2\sim F_{p,N-p}\ \text{under }H_0:\mu=\mu_0 . It is the multivariate analogue of Student’s t2t^2.

Mahalanobis’ D2D^2. For two samples from populations with a common dispersion matrix, D2=(x‾1−x‾2)′S−1(x‾1−x‾2),D^2=(\bar x_1-\bar x_2)'S^{-1}(\bar x_1-\bar x_2), with SS the pooled within-sample covariance matrix. It estimates the population distance Δ2=(μ1−μ2)′Σ−1(μ1−μ2)\Delta^2=(\mu_1-\mu_2)'\Sigma^{-1}(\mu_1-\mu_2).

Relationship. T2=n1n2n1+n2D2.T^2=\frac{n_1n_2}{n_1+n_2}D^2 . So D2D^2 describes the separation, while T2T^2 (and the corresponding FF) tests whether it is real: n1+n2−p−1(n1+n2−2)p⋅T2∼Fp,n1+n2−p−1when μ1=μ2.\frac{n_1+n_2-p-1}{(n_1+n_2-2)p}\cdot T^2\sim F_{p,n_1+n_2-p-1}\quad\text{when }\mu_1=\mu_2 .

Uses in tests of hypotheses.

  1. H0:μ=μ0H_0:\mu=\mu_0 for one population (one-sample T2T^2).
  2. H0:μ1=μ2H_0:\mu_1=\mu_2 for two populations (T2T^2, equivalently D2D^2).
  3. Paired observations: the one-sample test on differences.
  4. H0:Cμ=0H_0:C\mu=0, for example equality of the pp component means, or parallelism of two profiles.
  5. Significance of Fisher’s discriminant function. Its maximised separation is D2D^2, so testing D2=0D^2=0 tests whether the discriminant function is useful.
  6. Whether additional characters increase the distance significantly (Dp+q2D^2_{p+q} against Dp2D^2_p).
  7. Simultaneous confidence intervals for linear functions a′μa'\mu or a′(μ1−μ2)a'(\mu_1-\mu_2).
  8. Grouping populations by their pairwise D2D^2 values, as in Mahalanobis’ and Rao’s work on anthropometric and taxonomic classification.

✓ Answer checked step by step Every step was checked: the definitions of T² and D², the relation T² = n₁n₂D²/(n₁ + n₂) and the F forms of the tests.

↑ Back to the question list

More on Linear Inference and Multivariate Analysis

Questions: UPSC Civil Services (Main) Examination, Statistics Paper I, 1995–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted