Download Read the supplementary notes

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Probability wikipedia , lookup

Statistics wikipedia , lookup

Transcript
18.01A Central Limit Theorem and Confidence Intervals
Author: Jeremy Orloff
Read notes P section 5.
Read the supplementary notes
Central Limit Theorem: “Everything becomes normal.”
Let X be any random variable (discrete or continuous) with mean m and standard
deviation σ. Let X1 , X2 , . . . , Xn be n independent copies of X.
X1 + . . . + X n
If n is large then X =
is approximately normal with
n
σ
mean E(X) = m and standard deviation σ(X) = √ .
n
This gives precise statement of the ’common sense’ law of averages:
1. The average of many trials has the same expected value as one trial.
2. Averaging makes the spread (standard deviation) around the mean get smaller.
3. The distribution becomes more normal shaped as n increases.
(continued)
1
18.01A topic CLM (not done in fall ’07)
2
Example: Roll a die, X = number of spots.
We know m = 3.5, σ 2 = 17.5/6, σ = 1.708.
Roll the die 100 times and let X be the average number of spots.
What is the probability that X is within .5 of the true mean?
√
Since it is an average, X ≈ normal, with mean m and std. dev. σ = σ/ n = .1708.
.5
|X − m|
<
≈ P (Z < 2.9277) = .998.
⇒ P (|X − m| < .5) = P
σ
σ
answer: With 99.8% confidence the sample average is within .5 of the true mean.
Example: With 95% confidence X is within what range of the true mean?
We need to find r so that P (|X − m| < r) = .95.
The same argument as before shows
|X − m|
r
r
P (|X − m| < r) = .95 ⇔ .95 = P
<
≈ P (Z < ).
σ
σ
σ
r
⇒
= 2 ⇒ r = 2σ = .3416.
σ
Remark: Learn the long way before using the following shorter method.
Method 2: 95% confidence is 2 standard deviations, so r = 2σ = .3416.
Example: How many rolls should you take in order to have 68% confidence that the
average is within .5 of the true mean?
√
Long method: Let n = number of rolls ⇒ σ = 1.708/ n.
√
As above, we have .68 = P (|X − m| < .5) ≈ P (Z < .5/σ) = P (Z < .5 n/σ)
√
⇒ .5 n/σ = 1 ⇒ n = 4σ 2 = 70/6. answer: n = 12.
√
Short method: 68% confidence is 1 standard deviation, so .5/σ = .5 n/σ = 1 . . .
Example: Suppose after 100 rolls we find X = 2.9. Is the die fair?
We have X − m = .6. If the die is fair then P (|X − m| > .6) ≈ P (Z > .6/σ) =
P (Z > .6/.1708) = .0002.
A fair die would give this result only 1 in 5000 times. It is unlikely this die is fair.
Note: We can’t say it’s not fair, only that we have 99.98% confidence it’s not fair.
r
= c.
Summary: We have the general scheme P (|X − m| < r) ≈ P Z < √
σ/ n
m is in general unknown.
X is the experimental average.
n is the number of samples in the average.
r is the radius from the mean.
c is the confidence (probability) that X is within r of m.
In general, we are given two of the values n, r, c and have to find the third.
(continued)
18.01A topic CLM (not done in fall ’07)
3
Note: You never know that the true mean is within the given radius of X. You only
know the probability that it is. E.g., 95% confidence means that in 1/20 experiments
m is outside the interval around X.
What if you don’t know σ?
Example: (from the supplementary notes without the editorial comments) Let A
and B be two candidates for governor. Let p be the (unknown) fraction of voters who
support A, so 1 − p support B.
Suppose n = 100 voters are polled and 45 preferred A. Find an interval around .45
that contains the true fraction p with 95% confidence.
Let X be the random variable defined by polling one randomly chosen person about
who they prefer.
(
1 if A is preferred, P (1) = p
X=
0 if B is preferred, P (0) = 1 − p
p
⇒ m = m(X) = p and σ = σ(X) = p(1 − p).
After polling n people (n copies of X) we have X = fraction who support A.
√
Now we’re on familiar territory: X is approximately normal, σ = σ/ n and
√
P (|X − m| < r) = .95 ⇔ P (Z < r/σ) = .95. ⇒ r/σ = 2 ⇒ r = 2σ/ n = .2σ.
Incomplete answer: With 95% confidence the true fraction p is within .2σ of .45.
p
We don’t know σ exactly, but we do know σ = p(1 − p) ≤ 1/2 ⇒ r = .2σ ≤ .1
Taking a bigger interval only increases our confidence:
⇒ answer: with at least 95% confidence p = .45 ± .1, i.e. .35 ≤ p ≤ .55
The previous example contains a nice simple formula that you should remember:
1
In polling we have p = X ± √ with 95% confidence.
n
Example: A coin is tossed 1000 times and heads comes up 480 times. Is it a fair
coin?
Let X be the result of one toss, X = 1 for heads and X = 0 for tails.
i) If we toss it 1000 times then X is the fraction of heads. √
ii) If the coin is fair then m = 1/2, σ = 1/2 and σ = 1/(2 n) = .016.
iii) In our experiment |X − m| = .02.
Still assuming it’s fair, P (|X − m| > .02) ≈ P (Z > .02/σ) = P (Z > 1.26) = .1.
We could say, with 90% confidence the coin is not fair. But, 90% confidence means a
fair coin will give results like this 1 out of 10 times. A standard rule of thumb is that
we need 95% confidence to declare it unfair. So we would declare it suspect and call
tails if asked to bet on it.
(continued)
18.01A topic CLM (not done in fall ’07)
4
Confidence Intervals as Repeatable Experiments (For those who want to know.)
Confidence intervals are tricky. The main thing to remember is that any probability
implies an underlying sample space and an experiment to run repeatedly (at least in
principle) whose long term average gives the probability.
Big picture view of confidence intervals:
• The goal is to gain information about a quantity m.
• By some technique we produce a random interval I.
• We compute the probability that I contains m.
What’s the sample space and experiment?
The sample space is all the set of all possible intervals.
The experiment is the technique used to produce the interval.
Intervals I1 , I3 , I5 contain m, I2 , I4 , I6 do not.
A standard process for evaluating the estimate of m is the following.
1. Take n measurements of m, call them X1 , . . . , Xn .
2. Take the average X.
3. Create a random interval I = [X − r, X + r]
4. Compute (estimate) the probability c, that I contains m.
Now, c is a probability. If I repeated steps 1-3 many times, c is the fraction of times
the random interval I would contain m. We call c the confidence that m is in I.
How I choose r is part of the experimental design. It can be a simple or complicated
formula, as long as I can repeat the method of choosing it for each experiment.
In general, the bigger the interval, the more confident we can be.
We know from experience and the central limit theorem that if n is made bigger:
then the same interval gives a bigger confidence, or
we can achieve the same confidence with a smaller interval.
Remember, no matter what size we make the interval, or how many measurements
we make there is always the possibility that the interval does not contain m. The
most we can usually say is, how often this might happen, not if it happened on any
given experiment.