Probability and Statistics - 3
Probability and Statistics - 3
17.07.2020
Anh Tuan Tran (Ph.D.) & Thinh Tien Nguyen (Ph.D.)
1. Central Limit Theorem
Central Limit Theorem
Theorem:
Let X1 , … , X n be i.i.d. random variables with expected
value E Xi = μ and variance 0 < D Xi = σ2 < +∞
for i = 1, … , n.
Then, the random variable
X − μ X1 + ⋯ + Xn − nμ
Zn ≔ σ =
nσ
n
converges in distribution to the standard normal
random variable as n → +∞.
Central Limit Theorem
Example:
Toss a fair coin n times.
Let X i be 1 if Head occurs and 0 if Tail occurs in the ith
toss for i = 1, … , n.
E X i = p = 0.5 and D X i = p(1 − p) for i = 1, … , n.
Then, the random variable
X1 + ⋯ + Xn − np
Zn ≔
np 1 − p
converges in distribution to the standard normal random
variable as n → +∞.
Binom n, p converges to N np, np 1 − p as n → +∞.
Central Limit Theorem
n=2
Central Limit Theorem
n=5
Central Limit Theorem
n = 30
Central Limit Theorem
Example:
Roll n dice.
Let X i be the number occurs on the ith die for i = 1, … , n.
7 35
E Xi = and D Xi = for i = 1, … , n.
2 12
Then, the random variable
7
X1 + ⋯ + X n − n
Zn ≔ 2
35
n
12
converges in distribution to the standard normal random
variable as n → +∞.
7 35
Zn converges to N n, n as n → +∞.
2 12
Central Limit Theorem
n=1
Central Limit Theorem
n=2
Central Limit Theorem
n=8
Central Limit Theorem
Example:
Y = X1 + ⋯ + X50
P 90 ≤ Y ≤ 110
90 − 2 ⋅ 50 Y − 2 ⋅ 50 110 − 2 ⋅ 50
=P ≤ ≤
50 50 50
≈ P − 2 ≤ Z ≤ 2 ≈ 0.8427
Motivation problem 1:
Select randomly 100 people in a city to compute the
average height.
Repeat the above steps for few times, and the
records of the average height is a sequence
approximating 1.65 m.
The average height of the people in the city is
exactly 1.65 m or not?
Hypothesis testing
Motivation problem 2:
A dataset of the final scores of a group of 300
students.
The group can be divided into 2 subgroups of boys
and girls.
Compute the average score of each subgroup, boys:
7.91/10 and girls: 6.96/10
Sex affects the performance of the students? i.e. the
difference between the average scores is
significant?
Null and alternative hypotheses
Null hypothesis:
The hypothesis that is often the opposite of our
guess.
Denoted by H0 .
Alternative hypothesis:
The hypothesis that is often consistent with our
guess and is opposite to the null hypothesis.
Denoted by Ha or H1 .
Null and alternative hypotheses
Example 1 (One-sample test):
Two-tailed test:
The average height of the people of the city is exactly
1.65 m?
H0 : μ = 1.65
Ha : μ ≠ 1.65
One-tailed test (Right or left):
The average height of the people of the city is less
than or equal to (greater than or equal to) 1.65 m?
H0 : μ ≤ 1.65 H0 : μ ≥ 1.65
or
Ha : μ > 1.65 Ha : μ < 1.65
Null and alternative hypotheses
Definition:
x − 1.65
t≔ s
150
where
x is the average height of the sample,
s is the adjusted standard deviation of the sample.
Test statistic
Why t?
If the null hypothesis H0 is true and the average height of
the people in the city is exactly μ0 = 1.65 (m).
By the central limit theorem, for n large enough
X − μ0
T≔ ~N 0,1
S/ n
where
X is the random variable, the possible values of X are the
average heights of every sample of size n taken from the
people in the city,
S is the random variable, the possible values of S are the
adjusted standard deviations of every sample of size n
taken from the people in the city.
Test statistic
p-value
Definition:
Assume H0 is true.
Let T be a test statistic random variable deduced
from H0 .
Let t be the observed test statistic from the data.
Then
Right tests: p-value = P(T ≥ t|H0 ),
Left tests: p-value = P T ≤ t|H0 ,
Two-tailed tests:
p-value = 2 min P T ≥ t|H0 , P(T ≤ t|H0 )
p-value
Right-tailed test
p-value
p-value
Left-tailed test
p-value
p-value
Example:
Assume H0 is true.
The probability that H0 will be rejected is called a
significance level.
Denoted by α.
Example:
Right-tailed test
Significance level
Left-tailed test
Significance level
Two-tailed test
Accepting H0
X−1.65 x−1.65
T= S ~N(0,1) and t = s .
n n
In two-tailed tests:
H0 : μ = μ0
Ha : μ ≠ μ0
In one-tailed tests:
H0 : μ ≤ μ0 H0 : μ ≥ μ0
or
Ha : μ > μ0 Ha : μ < μ0
One-sample t-test
Test statistic:
x − μ0
t≔ s ~T n − 1
n
Density function:
X~T n . Then
n+1 n+1
Γ x2
−
2
2
f x = n 1+ .
nπΓ n
2
Student’s t-distribution
Gamma function:
+∞
Property:
Let
X~T n .
X~N 0,1 .
One-sample t-test
Example:
In two-tailed tests:
H0 : μ1 = μ2
Ha : μ1 ≠ μ2
In one-tailed tests:
H0 : μ1 ≤ μ2 H0 : μ1 ≥ μ2
or
Ha : μ1 > μ2 Ha : μ1 < μ2
Two-independent-samples t-test
Test statistic (Equal variances):
x1 − x2
t≔ ~T(n1 + n2 − 2)
1 1
sp +
n1 n2
Degree of freedom:
2 2 2
s1 s2
+
n1 n2
df ≔
2 2 2 2
1 s1 1 s2
+
n1 − 1 n1 n2 − 1 n2
Two-independent samples test
Example:
Equal variances:
t ≈ −28.23, df ≈ 9998, p − value ≈ 2.26e − 1.69
In two-tailed tests:
H0 : σ12 = σ22
Ha : σ12 ≠ σ22
In one-tailed tests:
H0 : σ12 ≤ σ22 H0 : σ12 ≥ σ22
or
Ha : σ12 > σ22 Ha : σ12 < σ22
F-test (two independent samples)
Test statistic:
s12
f ≔ 2 ~F n1 − 1, n2 − 1
s2
Density function:
H0 : μ1 = ⋯ = μk
Ha : ∃i ≠ j, μi ≠ μj
One-way ANOVA (Analysis of variances)
ni : the number of observed data of the ith group.
The observed data of the ith group are denoted by
xi1 , xi2 , … , xini
The average of the ith group:
ni
1
xi ≔ xij .
ni
j=1
The adjusted variance of the ith group:
ni
2 1 2
si ≔ xij − xi .
ni − 1
j=1
One-way ANOVA (Analysis of variances)
Test statistic:
n − k SSA
f≔ ⋅ ~F k − 1, n − k
k − 1 SSE
Comments: