Hypothesis Testing & Linear Model cover

Hypothesis Testing & Linear Model

2026-07-20 18:18:00# Statistics
  • simple test: Fully specify a distribution \longleftrightarrow composite test
  • one-sided hypotheses
  • two-sided hypotheses
  • two-sample nonparametric testing
  • fail to reject

Usually, our goal is to minimize the type II error while controlling type I error bellow a prespecified rate α[0,1]\alpha\in[0, 1] (called significance).

Significance level and power

Critical function

ϕ(x)={0acceptH0γ(0,1)rejectw.p.γ1rejectH0\phi(x)=\begin{cases} 0 & accept\,H_0\\ \gamma\in(0, 1) & reject\,w.p. \gamma \\ 1 & reject\,H_0 \end{cases}

or more commonly used, choosing a test statistic T(X)T(X) and a critical threshold:

ϕ(x)={0T(X)<cγ(0,1)T(X)=c1T(X)>c\phi(x)=\begin{cases} 0 & T(X)<c\\ \gamma\in(0, 1) & T(X)=c \\ 1 & T(X)>c \end{cases}

Power function βϕ(θ)=Eθ[ϕ(X)]=Pθ(Reject H0)\beta_\phi(\theta)=\mathbb{E}_\theta[\phi(X)]=P_\theta(Reject \ H_0). Our goal can be expressed as

arg maxϕEθ[ϕ(X)]forθΘ1  subjecttoEθ[ϕ(X)]αforθΘ0\operatorname*{arg\,max}_{\phi} \,\mathbb{E}_\theta[\phi(X)] \, for \, \theta\in\Theta_1 \ \ subject \, to \, \mathbb{E}_\theta[\phi(X)] \leq \alpha \, for \, \theta\in\Theta_0

Likelihood Ratio Test

Neyman-Pearson Lemma:

UMP Test:

p-values, confidence regions, and (mis-)interpreting Tests

Definition: P value (Informal): The probability of a test statistic T(X) to be at least as big as its realized value T(x), under the assumption that H0H_0 is true.

p(x)=supθΘ0Pθ(T(X)T(x))p(x)=\operatorname*{sup}_{\theta\in\Theta_0}\mathbb{P}_\theta(T(X)\geq T(x))

Definition: P value (formal) :

p(x)=sup{α:ϕα(x)<1}=inf{α:ϕα(x)=1}p(x)=\sup\{\alpha: \phi_\alpha(x) < 1\}=\inf\{\alpha: \phi_\alpha(x)=1\}

in terms of the rejection regions:

p(x)=sup{α:xRα}=inf{α:xRα}p(x)=\sup\{\alpha: x\notin R_\alpha\}=\inf\{\alpha: x\in R_\alpha\}

Confidence Interval/Region: C(X)C(X) is a 1α1-\alpha confidence region for g(θ)g(\theta) if:

Pθ(C(X))g(θ))1αfor allθΘP_\theta(C(X))\ni g(\theta))\geq1-\alpha \quad \text{for all}\, \theta\in\Theta

Duality with Test:

Suppose we have a level-α\alpha test ϕ(X,a)\phi(X, a) of H0:g(θ)=a v.s. H1:g(θ)aH_0: g(\theta)=a\text{ v.s. }H_1: g(\theta)\neq a for every aa, then we can use these tests to construct a (non-randomized) confidence region for g(θ)g(\theta) as follows:

C(X)={a:ϕ(X,a)<1}C(X)=\{a: \phi(X, a)<1\}

C(X)C(X) is all non-rejected values of aa, and it is a valid confidence region because

Pθ(C(X)g(θ))=Pθ(ϕ(X;g(θ))<1)1α\mathbb{P}_\theta(C(X)\ni g(\theta)) = P_\theta(\phi(X;g(\theta))<1)\geq1-\alpha

How to derive a level-α\alpha test ϕα\phi_\alpha from a confidence region?

ϕα(x)={0C(x)a1C(x)∌a\phi_\alpha(x)=\begin{cases} 0 & C(x)\ni a \\ 1 & C(x) \not\ni a \end{cases}

Testing in Linear Model

χ,t,F\chi, \,t, \, F distributions

  1. If z1,,zdi.i.d.N(0,1)z_1,\dots,z_d\overset{\text{i.i.d.}}{\sim}\mathcal{N}(0, 1), then V=dZi2χd2=Gamma(d/2,2)V=\sum_d Z_i^2\sim\chi_d^2=Gamma(d/2, 2)
    1. EV=d\mathbb{E}V=d, Var(V)=2dVar(V)=2d
    2. CLT: Vd2dN(0,1)\dfrac{V-d}{\sqrt{2d}}\Rightarrow N(0, 1)
  2. If zN(0,σ2)z\sim\mathcal{N}(0, \sigma^2) and Vσ2χd2V\sim\sigma^2\chi_d^2, zVz\perp V, then zv/dtdN(0,1)asd\frac{z}{\sqrt{v/d}}\sim t_d\Rightarrow \mathcal{N}(0, 1)\,as\,d\rightarrow\infty
  3. If V1σ2χd12V_1\sim\sigma^2\chi_{d_1}^2 and V2σ2χd22V_2\sim\sigma^2\chi_{d_2}^2, V1V2V_1\perp V_2, then V1/d1V2/d2Fd1,d21d1χd12asd2\frac{V_1/d_1}{V_2/d_2}\sim F_{d_1,d_2}\Rightarrow\dfrac{1}{d_1}\chi_{d_1}^2 \,as\, d_2\rightarrow\infty
    1. If TtdT\sim t_d, then T2F1,dT^2\sim F_{1, d}
  4. If TtdT\sim t_d then T2F1,dT^2\sim F_{1,d}

zdχd2tdz_d\longrightarrow \chi_d^2\longrightarrow t_d χd12,χd22Fd1,d2\chi_{d_1}^2, \chi_{d_2}^2\longrightarrow F_{d_1, d_2}

Change Basis

Assume XiN(μ,σ2)X_i \sim N(\mu, \sigma^2), construct

Q=[q1q2qn]Q=\begin{bmatrix} q_1 & q_2 & \dots & q_n \end{bmatrix}

Where

q1=1n1nq_1=\frac{1}{\sqrt{n}}1_n

QQ is a Orthogonal Unit Matrix:

Q=[q1Qr]Q=\begin{bmatrix} q_1 & Q_r \end{bmatrix}

with QQ=InQ'Q=I_n.

We have

Z=QXNn([nμ00],σ2In)Z = Q'X \sim N_n\left( \begin{bmatrix} \sqrt{n}\mu \\ 0 \\ \vdots \\ 0 \end{bmatrix}, \sigma^2 I_n \right) Zr=QrXN(0,σ2In1)S2=1n1Zr2σ2n1χn12Z_r = Q_r'X \sim N(0, \sigma^2 I_{n-1}) \Rightarrow S^2= \dfrac{1}{n-1} ||Z_r||^2 \sim \frac{\sigma^2}{n-1}\chi_{n-1}^{2}

and S2Z1S^2 \perp Z_1.

Canonical Linear Model

  1. σ2\sigma^2 known, d1=1d_1=1
  2. σ2\sigma^2 known, d11d_1\geq1
  3. σ2\sigma^2 unknown, d1=1d_1=1
  4. σ2\sigma^2 unknown, d11d_1\geq1

General Linear Model

Basic Setup:

  1. Observe YNn(θ,σ2In)Y\sim N_n(\theta, \sigma^2I_n), σ2>0\sigma^2>0.
  2. Test θΘ0\theta\in\Theta_0 vs. θΘ\Θ0\theta\in\Theta \backslash \Theta_0.
  3. Θ0Θ\Theta_0\subset\Theta, with dim(Θ0)=d0dim(\Theta_0)=d_0, dim(Θ)=d=d0+d1dim(\Theta)=d=d_0+d_1.

We rotate it into canonical form:

Z=QYNn([Q0θQ1θ0],σ2In)Z = Q'Y\sim N_n\left(\begin{bmatrix} Q_0'\theta \\ Q_1'\theta \\ 0 \end{bmatrix}, \sigma^2I_n\right)