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] α ∈ [ 0 , 1 ] (called significance).
Significance level and power
Critical function
ϕ ( x ) = { 0 a c c e p t H 0 γ ∈ ( 0 , 1 ) r e j e c t w . p . γ 1 r e j e c t H 0 \phi(x)=\begin{cases}
0 & accept\,H_0\\
\gamma\in(0, 1) & reject\,w.p. \gamma \\
1 & reject\,H_0
\end{cases} ϕ ( x ) = ⎩ ⎨ ⎧ 0 γ ∈ ( 0 , 1 ) 1 a cce pt H 0 r e j ec t w . p . γ r e j ec t H 0
or more commonly used, choosing a test statistic T ( X ) T(X) T ( X ) and a critical threshold:
ϕ ( x ) = { 0 T ( X ) < c γ ∈ ( 0 , 1 ) T ( X ) = c 1 T ( X ) > c \phi(x)=\begin{cases}
0 & T(X)<c\\
\gamma\in(0, 1) & T(X)=c \\
1 & T(X)>c
\end{cases} ϕ ( x ) = ⎩ ⎨ ⎧ 0 γ ∈ ( 0 , 1 ) 1 T ( X ) < c T ( X ) = c T ( X ) > c
Power function β ϕ ( θ ) = E θ [ ϕ ( X ) ] = P θ ( R e j e c t H 0 ) \beta_\phi(\theta)=\mathbb{E}_\theta[\phi(X)]=P_\theta(Reject \ H_0) β ϕ ( θ ) = E θ [ ϕ ( X )] = P θ ( R e j ec t H 0 ) . Our goal can be expressed as
arg max ϕ E θ [ ϕ ( X ) ] f o r θ ∈ Θ 1 s u b j e c t t o E θ [ ϕ ( X ) ] ≤ α f o r θ ∈ Θ 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 ϕ arg max E θ [ ϕ ( X )] f or θ ∈ Θ 1 s u bj ec t t o E θ [ ϕ ( X )] ≤ α f or θ ∈ Θ 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 H 0 H_0 H 0 is true.
p ( x ) = sup θ ∈ Θ 0 P θ ( T ( X ) ≥ T ( x ) ) p(x)=\operatorname*{sup}_{\theta\in\Theta_0}\mathbb{P}_\theta(T(X)\geq T(x)) p ( x ) = θ ∈ Θ 0 sup P θ ( T ( X ) ≥ 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\} p ( x ) = sup { α : ϕ α ( x ) < 1 } = inf { α : ϕ α ( x ) = 1 }
in terms of the rejection regions:
p ( x ) = sup { α : x ∉ R α } = inf { α : x ∈ R α } p(x)=\sup\{\alpha: x\notin R_\alpha\}=\inf\{\alpha: x\in R_\alpha\} p ( x ) = sup { α : x ∈ / R α } = inf { α : x ∈ R α }
Confidence Interval/Region : C ( X ) C(X) C ( X ) is a 1 − α 1-\alpha 1 − α confidence region for g ( θ ) g(\theta) g ( θ ) if:
P θ ( C ( X ) ) ∋ g ( θ ) ) ≥ 1 − α for all θ ∈ Θ P_\theta(C(X))\ni g(\theta))\geq1-\alpha \quad \text{for all}\, \theta\in\Theta P θ ( C ( X )) ∋ g ( θ )) ≥ 1 − α for all θ ∈ Θ
Duality with Test :
Suppose we have a level-α \alpha α test ϕ ( X , a ) \phi(X, a) ϕ ( X , a ) of H 0 : g ( θ ) = a v.s. H 1 : g ( θ ) ≠ a H_0: g(\theta)=a\text{ v.s. }H_1: g(\theta)\neq a H 0 : g ( θ ) = a v.s. H 1 : g ( θ ) = a for every a a a , then we can use these tests to construct a (non-randomized) confidence region for g ( θ ) g(\theta) g ( θ ) as follows:
C ( X ) = { a : ϕ ( X , a ) < 1 } C(X)=\{a: \phi(X, a)<1\} C ( X ) = { a : ϕ ( X , a ) < 1 }
C ( X ) C(X) C ( X ) is all non-rejected values of a a a , 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 P θ ( C ( X ) ∋ g ( θ )) = P θ ( ϕ ( X ; g ( θ )) < 1 ) ≥ 1 − α
How to derive a level-α \alpha α test ϕ α \phi_\alpha ϕ α from a confidence region?
ϕ α ( x ) = { 0 C ( x ) ∋ a 1 C ( x ) ∌ a \phi_\alpha(x)=\begin{cases}
0 & C(x)\ni a \\
1 & C(x) \not\ni a
\end{cases} ϕ α ( x ) = { 0 1 C ( x ) ∋ a C ( x ) ∋ a
Testing in Linear Model
χ , t , F \chi, \,t, \, F χ , t , F distributions
If z 1 , … , z d ∼ i.i.d. N ( 0 , 1 ) z_1,\dots,z_d\overset{\text{i.i.d.}}{\sim}\mathcal{N}(0, 1) z 1 , … , z d ∼ i.i.d. N ( 0 , 1 ) , then
V = ∑ d Z i 2 ∼ χ d 2 = G a m m a ( d / 2 , 2 ) V=\sum_d Z_i^2\sim\chi_d^2=Gamma(d/2, 2) V = d ∑ Z i 2 ∼ χ d 2 = G amma ( d /2 , 2 )
E V = d \mathbb{E}V=d E V = d , V a r ( V ) = 2 d Var(V)=2d V a r ( V ) = 2 d
CLT: V − d 2 d ⇒ N ( 0 , 1 ) \dfrac{V-d}{\sqrt{2d}}\Rightarrow N(0, 1) 2 d V − d ⇒ N ( 0 , 1 )
If z ∼ N ( 0 , σ 2 ) z\sim\mathcal{N}(0, \sigma^2) z ∼ N ( 0 , σ 2 ) and V ∼ σ 2 χ d 2 V\sim\sigma^2\chi_d^2 V ∼ σ 2 χ d 2 , z ⊥ V z\perp V z ⊥ V , then
z v / d ∼ t d ⇒ N ( 0 , 1 ) a s d → ∞ \frac{z}{\sqrt{v/d}}\sim t_d\Rightarrow \mathcal{N}(0, 1)\,as\,d\rightarrow\infty v / d z ∼ t d ⇒ N ( 0 , 1 ) a s d → ∞
If V 1 ∼ σ 2 χ d 1 2 V_1\sim\sigma^2\chi_{d_1}^2 V 1 ∼ σ 2 χ d 1 2 and V 2 ∼ σ 2 χ d 2 2 V_2\sim\sigma^2\chi_{d_2}^2 V 2 ∼ σ 2 χ d 2 2 , V 1 ⊥ V 2 V_1\perp V_2 V 1 ⊥ V 2 , then
V 1 / d 1 V 2 / d 2 ∼ F d 1 , d 2 ⇒ 1 d 1 χ d 1 2 a s d 2 → ∞ \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 V 2 / d 2 V 1 / d 1 ∼ F d 1 , d 2 ⇒ d 1 1 χ d 1 2 a s d 2 → ∞
If T ∼ t d T\sim t_d T ∼ t d , then T 2 ∼ F 1 , d T^2\sim F_{1, d} T 2 ∼ F 1 , d
If T ∼ t d T\sim t_d T ∼ t d then T 2 ∼ F 1 , d T^2\sim F_{1,d} T 2 ∼ F 1 , d
z d ⟶ χ d 2 ⟶ t d z_d\longrightarrow \chi_d^2\longrightarrow t_d z d ⟶ χ d 2 ⟶ t d
χ d 1 2 , χ d 2 2 ⟶ F d 1 , d 2 \chi_{d_1}^2, \chi_{d_2}^2\longrightarrow F_{d_1, d_2} χ d 1 2 , χ d 2 2 ⟶ F d 1 , d 2
Change Basis
Assume X i ∼ N ( μ , σ 2 ) X_i \sim N(\mu, \sigma^2) X i ∼ N ( μ , σ 2 ) , construct
Q = [ q 1 q 2 … q n ] Q=\begin{bmatrix}
q_1 &
q_2 &
\dots &
q_n
\end{bmatrix} Q = [ q 1 q 2 … q n ]
Where
q 1 = 1 n 1 n q_1=\frac{1}{\sqrt{n}}1_n q 1 = n 1 1 n
Q Q Q is a Orthogonal Unit Matrix:
Q = [ q 1 Q r ] Q=\begin{bmatrix}
q_1 & Q_r
\end{bmatrix} Q = [ q 1 Q r ]
with Q ′ Q = I n Q'Q=I_n Q ′ Q = I n .
We have
Z = Q ′ X ∼ N n ( [ n μ 0 ⋮ 0 ] , σ 2 I n ) Z = Q'X \sim N_n\left( \begin{bmatrix}
\sqrt{n}\mu \\ 0 \\ \vdots \\ 0
\end{bmatrix}, \sigma^2 I_n \right) Z = Q ′ X ∼ N n n μ 0 ⋮ 0 , σ 2 I n
Z r = Q r ′ X ∼ N ( 0 , σ 2 I n − 1 ) ⇒ S 2 = 1 n − 1 ∣ ∣ Z r ∣ ∣ 2 ∼ σ 2 n − 1 χ n − 1 2 Z_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} Z r = Q r ′ X ∼ N ( 0 , σ 2 I n − 1 ) ⇒ S 2 = n − 1 1 ∣∣ Z r ∣ ∣ 2 ∼ n − 1 σ 2 χ n − 1 2
and S 2 ⊥ Z 1 S^2 \perp Z_1 S 2 ⊥ Z 1 .
Canonical Linear Model
σ 2 \sigma^2 σ 2 known, d 1 = 1 d_1=1 d 1 = 1
σ 2 \sigma^2 σ 2 known, d 1 ≥ 1 d_1\geq1 d 1 ≥ 1
σ 2 \sigma^2 σ 2 unknown, d 1 = 1 d_1=1 d 1 = 1
σ 2 \sigma^2 σ 2 unknown, d 1 ≥ 1 d_1\geq1 d 1 ≥ 1
General Linear Model
Basic Setup:
Observe Y ∼ N n ( θ , σ 2 I n ) Y\sim N_n(\theta, \sigma^2I_n) Y ∼ N n ( θ , σ 2 I n ) , σ 2 > 0 \sigma^2>0 σ 2 > 0 .
Test θ ∈ Θ 0 \theta\in\Theta_0 θ ∈ Θ 0 vs. θ ∈ Θ \ Θ 0 \theta\in\Theta \backslash \Theta_0 θ ∈ Θ\ Θ 0 .
Θ 0 ⊂ Θ \Theta_0\subset\Theta Θ 0 ⊂ Θ , with d i m ( Θ 0 ) = d 0 dim(\Theta_0)=d_0 d im ( Θ 0 ) = d 0 , d i m ( Θ ) = d = d 0 + d 1 dim(\Theta)=d=d_0+d_1 d im ( Θ ) = d = d 0 + d 1 .
We rotate it into canonical form:
Z = Q ′ Y ∼ N n ( [ Q 0 ′ θ Q 1 ′ θ 0 ] , σ 2 I n ) Z = Q'Y\sim N_n\left(\begin{bmatrix}
Q_0'\theta \\
Q_1'\theta \\
0
\end{bmatrix}, \sigma^2I_n\right) Z = Q ′ Y ∼ N n Q 0 ′ θ Q 1 ′ θ 0 , σ 2 I n