Gov 2000: 4. Sums, Means, and Limit Theorems
Matthew Blackwell
Fall 2016
1 / 60
Gov 2000: 4. Sums, Means, and Limit Theorems Matthew Blackwell - - PowerPoint PPT Presentation
Gov 2000: 4. Sums, Means, and Limit Theorems Matthew Blackwell Fall 2016 1 / 60 1. Sums and Means of Random Variables 2. Useful Inequalities 3. Law of Large Numbers 4. Central Limit Theorem 5. More Exotic CLTs* 6. Wrap-up 2 / 60 Where
Matthew Blackwell
Fall 2016
1 / 60
2 / 60
samples
3 / 60
variable: ๐1, ๐2, โฆ , ๐๐
(๐1, ๐1), (๐2, ๐2), โฆ , (๐๐, ๐๐)
โถ Almost all statistical procedures involve a sum/mean. โถ What are the properties of these sums and means? โถ Can they tell us anything about the distribution of ๐๐?
4 / 60
5 / 60
โถ Has a mean ๐ฝ[๐1 + ๐2] and a variance ๐[๐1 + ๐2]
ฬ ๐ = ๐1 + ๐2 2
6 / 60
๐1 ๐2 ๐1 + ๐2 ฬ ๐ draw 1 20 71 91 45.5 draw 2 12 66 78 39 draw 3 59 75 134 67 draw 4 3 58 61 30.5 โฎ โฎ โฎ โฎ โฎ distribution
distribution
7 / 60
distributed r.v.s, ๐1, โฆ , ๐๐
โถ Random sample of ๐ respondents on a survey question. โถ Written โi.i.d.โ
โ ๐๐ for all ๐ โ ๐
โถ ๐ฝ[๐๐] = ๐ for all ๐ โถ ๐[๐๐] = ๐2 for all ๐ 8 / 60
๐ โ๐ ๐=1 ๐๐
โถ What is the expectation of this distribution, ๐ฝ[๐๐]? โถ What is the variance of this distribution, ๐[๐๐]? โถ What is the p.d.f. of the distribution?
9 / 60
Mean and variance of the sample mean
Suppose that ๐1, โฆ , ๐๐ is are i.i.d. r.v.s with ๐ฝ[๐๐] = ๐ and ๐[๐๐] = ๐2. Then: ๐ฝ[๐๐] = ๐ ๐[๐๐] = ๐2 ๐
โถ Sample mean get the right answer on average โถ Variance of ๐๐ depends on the variance of ๐๐ and the sample
size
โถ Not dependent on the (full) distribution of ๐๐!
โ๐
10 / 60
11 / 60
donโt know (or donโt want to assume) a distribution.
subject to some restrictions like fjnite variance.
โถ Build toward massively important results like LLN โถ Inequalities used regularly throughout statistics โถ Gives us some practice with proofs/analytic reasoning 12 / 60
Markov Inequality
Suppose that ๐ is r.v. such that โ(๐ โฅ 0) = 1. Then, for every real number ๐ข > 0, โ(๐ โฅ ๐ข) โค ๐ฝ[๐] ๐ข .
โ(๐ โฅ 100) โค 0.01
probability can be in the tail.
13 / 60
๐ฝ[๐] = โ
๐ฆ
๐ฆ๐๐(๐ฆ) = โ
๐ฆ<๐ข
๐ฆ๐๐(๐ฆ) + โ
๐ฆโฅ๐ข
๐ฆ๐๐(๐ฆ)
14 / 60
Chebyshev Inequality
Suppose that ๐ is r.v. for which ๐[๐] < โ. Then, for every real number ๐ข > 0, โ(|๐ โ ๐ฝ[๐]| โฅ ๐ข) โค ๐[๐] ๐ข2 .
from its mean.
15 / 60
โถ โ โ(๐ โฅ 0) = 1 (nonnegative) โถ ๐ฝ[๐] = ๐ฝ[(๐ โ ๐ฝ[๐])2] = ๐[๐] (defjnition of variance)
squared both sides.
โ(|๐ โ ๐ฝ[๐]| โฅ ๐ข) = โ(๐ โฅ ๐ข2) โค ๐ฝ[๐] ๐ข2 = ๐[๐] ๐ข2
16 / 60
vote for Donald Trump, ๐, from a random sample of size ๐.
โถ ๐1, ๐2, โฆ , ๐๐ indicating voting intention for Trump for each
respondent.
โถ By our earlier, calculation, ๐ฝ[๐๐] = ๐ and ๐[๐๐] = ๐2
๐
โถ Since this is a Bernoulli r.v., we have ๐2 = ๐(1 โ ๐)
๐๐ is within 0.02 of the true ๐?
โถ How to guarantee a margin of error of ยฑ 2 percentage points? 17 / 60
โ(|๐๐ โ ๐| โค 0.02) โฅ 0.95 โบ โ(|๐๐ โ ๐| โฅ 0.02) โค 0.05
โ(|๐๐ โ ๐| โฅ 0.02) โค ๐[๐๐] 0.022 = ๐(1 โ ๐) 0.0004๐
โถ Conservative to use largest possible variance. โถ It canโt be bigger than ๐(1 โ ๐) โค (1/2) โ (1/2) = (1/4)
โ(|๐๐ โ ๐| โฅ 0.02) โค ๐(1 โ ๐) 0.0004๐ โค 1 0.0016๐
(1/0.0016๐) โค 0.05, which gives us ๐ โฅ 12, 500!!
18 / 60
percentage points?
but actual probabilities are much smaller.
โถ Weโre also using the โworst-caseโ variance of 0.25.
and show the distribution of the means.
โถ What proportion of these are within 0.02 of ๐? 19 / 60
nsims <- 1000 holder <- rep(NA, times = nsims) for (i in 1:nsims) { this.samp <- rbinom(n = 12500, size = 1, prob = 0.4) holder[i] <- mean(this.samp) } mean(abs(holder - 0.4) > 0.02) ## [1] 0
0.00 0.01 0.02 0.03 20 40 60 80 xn โ p Density
20 / 60
21 / 60
know that:
โถ Expectation is ๐ฝ[๐๐] = ๐ฝ[๐๐] = ๐ โถ Variance is ๐[๐๐] = ๐2
๐ where ๐2 = ๐[๐๐]
โถ Some bounds on tail probabilities from Chebyshev. โถ None of these rely on a specifjc distribution for ๐๐!
22 / 60
increasing ๐: ๐1 = ๐1 ๐2 = (1/2) โ (๐1 + ๐2) ๐3 = (1/3) โ (๐1 + ๐2 + ๐3) ๐4 = (1/4) โ (๐1 + ๐2 + ๐3 + ๐4) ๐5 = (1/5) โ (๐1 + ๐2 + ๐3 + ๐4 + ๐5) โฎ ๐๐ = (1/๐) โ (๐1 + ๐2 + ๐3 + ๐4 + ๐5 + โฏ + ๐๐)
23 / 60
Convergence in probability
A sequence of random variables, ๐1, ๐2, โฆ, is said to converge in probability to a value ๐ if for every ๐ > 0, โ(|๐๐ โ ๐| > ๐) โ 0, as ๐ โ โ. We write this ๐๐
๐
โ ๐.
interval around ๐ approaches 0 as ๐ โ โ
๐
โ ๐.
24 / 60
Theorem: Weak Law of Large Numbers
Let ๐1, โฆ , ๐๐ be a an i.i.d. draws from a distribution with mean ๐ and fjnite variance ๐2. Let ๐๐ = 1
๐ โ๐ ๐=1 ๐๐. Then, ๐๐ ๐
โ ๐.
to 0 as ๐ gets big.
โถ The distribution of ๐๐ โcollapsesโ on ๐
a fjnite variance!
25 / 60
0 โค โ(|๐๐ โ ๐| โฅ ๐) โค ๐[๐๐] ๐2 = ๐2 ๐๐2
theorem implies lim
๐โโ โ(|๐๐ โ ๐| > ๐) = 0
26 / 60
rate 0.5
nsims <- 10000 holder <- matrix(NA, nrow = nsims, ncol = 6) for (i in 1:nsims) { s5 <- rexp(n = 5, rate = 0.5) s15 <- rexp(n = 15, rate = 0.5) s30 <- rexp(n = 30, rate = 0.5) s100 <- rexp(n = 100, rate = 0.5) s1000 <- rexp(n = 1000, rate = 0.5) s10000 <- rexp(n = 10000, rate = 0.5) holder[i, 1] <- mean(s5) holder[i, 2] <- mean(s15) holder[i, 3] <- mean(s30) holder[i, 4] <- mean(s100) holder[i, 5] <- mean(s1000) holder[i, 6] <- mean(s10000) }
27 / 60
1 2 3 4 1 2 3 4 5 6 Density n = 15
28 / 60
1 2 3 4 1 2 3 4 5 6 Density n = 30
29 / 60
1 2 3 4 1 2 3 4 5 6 Density n = 100
30 / 60
1 2 3 4 1 2 3 4 5 6 Density n = 1000
31 / 60
๐
โ ๐, then ๐(๐๐)
๐
โ ๐(๐) for any continuous function ๐.
๐
โ ๐ and ๐๐
๐
โ ๐, then
โถ ๐๐ + ๐๐
๐
โ ๐ + ๐
โถ ๐๐๐๐
๐
โ ๐๐
โถ ๐๐/๐๐
๐
โ ๐/๐ if ๐ > 0
โถ (๐๐)
2 ๐
โ ๐2
โถ log(๐๐)
๐
โ log(๐)
32 / 60
33 / 60
know that:
โถ ๐ฝ[๐๐] = ๐ and ๐[๐๐] = ๐2
๐
โถ ๐๐ converges to ๐ as ๐ gets big โถ Chebyshev provides some bounds on probabilities. โถ Still no distributional assumptions about ๐๐!
โถ Can we approximate Pr(๐ < ๐๐ < ๐)? โถ What family of distributions (Binomial, Uniform, Gamma,
etc)?
34 / 60
Convergence in distribution
Let ๐1, ๐2, โฆ, be a sequence of r.v.s, and for ๐ = 1, 2, โฆ let ๐บ๐(๐จ) be the c.d.f. of ๐๐. Then it is said that ๐1, ๐2, โฆ converges in distribution to r.v. ๐ with c.d.f. ๐บ๐ if lim
๐โโ ๐บ๐(๐ฆ) = ๐บ๐(๐ฆ),
which we write as ๐๐
๐
โ ๐.
to the distribution of ๐
continuous.
๐
โ ๐, then ๐๐
๐
โ ๐
35 / 60
and dividing by its standard deviation: ๐ = ๐ โ ๐ฝ[๐] โ๐[๐]
to yourself):
โถ ๐ฝ[๐] = 0 โถ ๐[๐] = 1
36 / 60
Central Limit Theorem
Let ๐1, โฆ , ๐๐ be i.i.d. r.v.s from a distribution with mean ๐ and variance 0 < ๐2 < โ. Then, ๐๐ โ ๐ ๐/โ๐
๐
โ ๐(0, 1).
about the distribution of ๐๐
โถ โ easy approximations to probability statements about ๐๐
when ๐ is big!
37 / 60
set.seed(2138) nsims <- 10000 holder2 <- matrix(NA, nrow = nsims, ncol = 6) for (i in 1:nsims) { s5 <- rbinom(n = 5, size = 1, prob = 0.25) s15 <- rbinom(n = 15, size = 1, prob = 0.25) s30 <- rbinom(n = 30, size = 1, prob = 0.25) s100 <- rbinom(n = 100, size = 1, prob = 0.25) s1000 <- rbinom(n = 1000, size = 1, prob = 0.25) s10000 <- rbinom(n = 10000, size = 1, prob = 0.25) holder2[i, 1] <- mean(s5) holder2[i, 2] <- mean(s15) holder2[i, 3] <- mean(s30) holder2[i, 4] <- mean(s100) holder2[i, 5] <- mean(s1000) holder2[i, 6] <- mean(s10000) }
38 / 60
1 2 3 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Density n = 5
๐/โ5
39 / 60
1 2 3 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Density n = 15
๐/โ15
40 / 60
1 2 3 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Density n = 30
๐/โ30
41 / 60
1 2 3 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Density n = 100
๐/โ100
42 / 60
1 2 3 0.0 0.2 0.4 0.6 0.8 1.0 1.2 Density n = 10000
๐/โ10000
43 / 60
2 4
44 / 60
2 4 0.68
45 / 60
2 4 0.95
46 / 60
2 4 0.997
47 / 60
pnorm(2) - pnorm(-2) ## [1] 0.9545
๐/โ๐ between โ2 and 2:
โถ ๐ = 15 โ 0.9683 โถ ๐ = 30 โ 0.9666 โถ ๐ = 100 โ 0.9523 โถ ๐ = 1000 โ 0.9551 โถ ๐ = 10000 โ 0.9546
distribution of the ๐๐
โถ Obviously if ๐๐ โผ ๐(0, 1) itโs going to be perfect with ๐ = 1 48 / 60
large-sample distribution of an estimator is.
49 / 60
0.02 from the true ๐ to be 95%.
โ(|๐๐ โ ๐| > 0.02) โค 0.05
๐๐ โ ๐ โ ๐ (0, ๐2/๐)
โถ ๐๐ โ ๐ โ ๐ (0, 1
4๐)
โถ Standardizing โ ๐ = (๐๐โ๐)
1/โ4๐ = 2โ๐(๐๐ โ ๐) โ ๐(0, 1)
โ(|๐๐ โ ๐| > 0.02) โค 0.05 โบ โ(|๐| > 0.02 ร 2โ๐) โค 0.05
50 / 60
โ(|๐| > 0.04โ๐) โค 0.05 โ(๐ < โ0.04โ๐) + โ(๐ > 0.04โ๐) โค 0.05
โถ Upper tail probs = lower tail probs โถ โ(๐ < โ0.04โ๐) = โ(๐ > 0.04โ๐)
2 ร โ(๐ < โ0.04โ๐) โค 0.05 โ(๐ < โ0.04โ๐) โค 0.025
โถ Inverse of the c.d.f. called the quantile: ๐ = ๐บโ1(0.025) โถ ๐ = ๐บโ1(๐) is the (smallest) value of the r.v. such that
โ(๐ โค ๐) = ๐บ(๐) โฅ ๐
51 / 60
qnorm(0.025, mean = 0, sd = 1) ## [1] -1.96
52 / 60
nsims <- 1000 holder <- rep(NA, times = nsims) for (i in 1:nsims) { this.samp <- rbinom(n = 2401, size = 1, prob = 0.4) holder[i] <- mean(this.samp) } mean(abs(holder - 0.4) > 0.02) ## [1] 0.052
0.00 0.01 0.02 0.03 10 20 30 40 xn โ p Density
53 / 60
54 / 60
with means ๐ฝ[๐๐] = ๐๐ and variances ๐[๐๐] = ๐2
๐ .
๐๐ = โ๐
๐=1 ๐๐ โ โ๐ ๐=1 ๐๐
(โ๐
๐=1 ๐2 ๐ ) 1/2
โถ No need to divide by ๐ because there are ๐ entries in the sum
โ๐
๐=1 ๐๐
apply?
55 / 60
Liapounov CLT
Suppose that the r.v.s ๐1, ๐2, โฆ are independent and that ๐ฝ[|๐๐ โ ๐๐|3] < โ for ๐ = 1, 2, โฆ. Also, suppose that lim
๐โโ
โ๐
๐=1 ๐ฝ [|๐๐ โ ๐๐|3]
(โ๐
๐=1 ๐2 ๐ ) 3/2
= 0. Then, ๐๐ = โ๐
๐=1 ๐๐ โ โ๐ ๐=1 ๐๐
(โ๐
๐=1 ๐2 ๐ ) 1/2 ๐
โ ๐(0, 1)
โtoo bigโ that could dominate the sum
56 / 60
What about dependent sequences?
โถ What does dependent sequence mean? Cov[๐๐, ๐๐] โ 0
not too correlated, not too big r.v.s
57 / 60
58 / 60
with simulations.
59 / 60
r.v.s
โถ Expectation ๐ฝ[๐๐] = ๐ โถ Variance ๐[๐๐] = ๐2/๐ โถ Converges in probability to true mean (LLN) โถ Converges in distribution to a normal distribution (CLT)
parameters.
60 / 60