STAT 3690 Lecture 10
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
STAT 3690 Lecture 10
2022
Testing on u (J&W Sec. 5.2 & 5.3)
● x1 , . . . , xn MVNp (u, Σ) n > p
● Hypotheses: H0 : u = u0 v.s. H1 : u u0
● Recall the univariate case (p = 1)
- The model reduces to X1 , . . . , Xn N (µ, σ2 )
- Hypotheses reduces to H0 : µ = µ0 v.s. H1 : µ µ0
- and s2 are sample mean and sample variance, respectively
- Known σ 2
* Name of approach: Z-test (also LRT)
* Test statistic: In( - µ0 )/σ ~ N (0, 1) under H0 ' OR n( - µ0 )2 /σ 2 ~ χ(1) under H0
* Rejction region at level α : R = {x1 , . . . , xn : In| - µ0 |/σ 2 Φ 1_(_1)α/2} = {x1 , . . . , xn : n( - µ0 )2 /σ 2 2 χ1(2) _α,1}
' Φ 1_(_1)α/2: the (1 - α/2)-quantile of N (0, 1)
' χ1(2) _α,1: the (1 - α)-quantile of χ2 (1)
- Unknown σ 2
* Name of approach: t-test (also LRT)
* Test statistic: In( - µ0 )/s ~ t(n - 1) under H0 ' OR n( - µ0 )2 /s2 ~ F (1, n - 1) under H0
* Rejction region at level α : R = {x1 , . . . , xn : In| - µ0 |/s 2 t1 _α/2,n _ 1 } = {x1 , . . . , xn :
n( - µ0 )2 /s2 2 F1 _α,1,n _ 1 }
' t1 _α/2,n _ 1 : the (1 - α/2)-quantile of t(n - 1)
' F1 _α,1,n _ 1 : the (1 - α)-quantile of F (1, n - 1)
● Multivariate case (with known 五)
- Name of approach: LRT
- Test statistic: n( - u0 )T 五_ 1 ( - u0 ) ~ χ2 (p) under H0
- Rejction region at level α : R = {z1 , . . . , zn : n( - u0 )T 五_ 1 ( - u0 ) 2 χ1(2) _α,p }
- p-value: p(z1 , . . . , zn ) = 1 - Fχ2 (p){n( - u0 )T 五_ 1 ( - u0 )}
* Fχ2 (p): the cdf of χ2 (p)
options(digits = 4)
install.packages(c ("dslabs"))
library(dslabs)
data("gapminder")
head(gapminder)
dataset = as.matrix(gapminder[
!is.na (gapminder$infant_mortality),
c ("infant_mortality" , "life_expectancy" , "fertility")])
# Aoouka ua 4mnu sgek-
Sigma <- matrix(c (555 , - 170 , 30 ,
-170 , 65 , -10 ,
30 , -10 , 2), ncol = 3)
(mu_hat <- colMeans (dataset))
# 7aot ku = ku o
mu_0 <- c (25 , 50 , 3)
n = nrow (dataset)
p = ncol(dataset)
(test.stat <- drop(
n * t(mu_hat - mu_0) %*% solve(Sigma) %*% (mu_hat - mu_0)
))
test.stat >= qchisq(0.95 , df=p)
(p.val = 1-pchisq(test.stat, df=p))
● Report: Testing hypotheses H0 : u = [25, 50, 3]T v.s. H1 : u [25, 50, 3]T , we carried on the LRT and obtained 450477 as the value of test statistic. The corresponding p-value (resp. rejection region) was 0 (resp. [7.815, o)). So, at the .05 (significance) level, there was a strong statistical evidence implying the rejection of H0 , i.e., we believed that the mean vector is not [25, 50, 3]T .
● Multivariate case (with unknown 五)
- Name of approach: LRT
- Test statistic: n( - u0 )T S_ 1 ( - u0 ) ~ T2 (p, n - 1) = F (p, n - p) under H0
- Rejction region at level α : R = {z1 , . . . , zn : ( - u0 )T S_ 1 ( - u0 ) 2 F1 _α,p,n _p }
- p-value: p(z1 , . . . , zn ) = 1 - FF (p,n _p){ ( - u0 )T S_ 1 ( - u0 )}
* FF (p,n _p): the cdf of F (p, n - p)
dataset = as.matrix(gapminder[
!is.na (gapminder$infant_mortality),
c ("infant_mortality" , "life_expectancy" , "fertility")])
(mu_hat <- colMeans (dataset))
# 7aot ku = ku o
mu_0 <- c (25 , 50 , 3)
n = nrow (dataset)
p = ncol(dataset)
(test.stat <- drop(
n * t(mu_hat - mu_0) %*% solve(cov (dataset)) %*% (mu_hat - mu_0)
))
(cri.point = (n-1)*p/(n-p)*qf(.95, p, n-p))
test.stat >= cri.point
(p.val = 1-pf((n-p)/(n-1)/p*test.stat, p, n-p))
● Report: Testing hypotheses H0 : u = [25, 50, 3]T v.s. H1 : u [25, 50, 3]T , we carried on the LRT and obtained 249718 as the value of test statistic. The corresponding p-value (resp. rejection region) was 0 (resp. [7.819, o)). So, at the .05 (significance) level, there was a strong statistical evidence implying the rejection of H0 , i.e., we believed that the mean vector is not [25, 50, 3]T .
2022-03-17