27
Hadley Wickham Stat310 Confidence intervals Thursday, 15 April 2010

22 confidence

Embed Size (px)

Citation preview

Page 1: 22 confidence

Hadley Wickham

Stat310Confidence intervals

Thursday, 15 April 2010

Page 2: 22 confidence

Quiz

• Pick up quiz on your way in

• Start at 1pm

• Finish at 1:10pm

• Closed book

Thursday, 15 April 2010

Page 3: 22 confidence

1. Test extra credit

2. Inference roadmap

3. Steps for making a confidence interval

4. One more sampling distribution (the t-distribution)

Thursday, 15 April 2010

Page 4: 22 confidence

Homework graded out 104% of overall grade (= 20% of two tests)

Will act as extra credit for the test. (i.e. there is no penalty you don’t do it)

Due next Thursday.

The extra 5% of the grade will be distributed across all other assessment.

Test makeupI still need one

party planner!

Thursday, 15 April 2010

Page 5: 22 confidence

What we want to do

Given data:

• Estimate true value of parameter (last week)

• Quantify uncertainty of estimate (today)

• Test whether true value is a certain value (Thursday)

Thursday, 15 April 2010

Page 6: 22 confidence

• Construct an estimator

• Method of moments

• Maximum likelihood

• Work out its distribution

• Sampling distribution of mean

• Sampling distribution of variance

• General properties of ML (not in this course)

Tools

Thursday, 15 April 2010

Page 7: 22 confidence

Set up

I repeated an experiment defined by Poisson(λ) 10 times, and recorded the following results: 6 11 10 6 12 7 8 5 7 10

The MLE of λ is 8.2, and its standard deviation is 0.90.

What is the distribution of the estimate? (Remember that it’s a mean) Can you construct an interval that will contain λ 95% of the time?

Thursday, 15 April 2010

Page 8: 22 confidence

Steps

1. Identify distribution that connects estimator and true value (4 choices).

2. Form confidence interval for known (sampling) distribution, and work out bounds.

3. Back transform.

4. Write as interval.

5. Plug in sample estimates (actual numbers).

Thursday, 15 April 2010

Page 9: 22 confidence

Your turn

Work through the steps on the handout.

Thursday, 15 April 2010

Page 10: 22 confidence

Confidence interval

A confidence interval is a simple numerical summary of the uncertainty of an estimate.

A 95% confidence interval will contain the true value 95% of the time.

An additional constraint is that we want the confidence interval to be a short as possible.

Thursday, 15 April 2010

Page 11: 22 confidence

expt

8

9

10

11

12

50 100 150 200

Each line = 95% confidence interval from one experiment

Thursday, 15 April 2010

Page 12: 22 confidence

expt

8

9

10

11

12

50 100 150 200

Horizontal line = true value

Thursday, 15 April 2010

Page 13: 22 confidence

expt

8

9

10

11

12

50 100 150 200

Red intervals don’t include true value

There are 13 red lines and 200 experiments. Is this an ok interval?

Thursday, 15 April 2010

Page 14: 22 confidence

Your turn

What’s wrong with a statement like this:

P(2 < μ < 6) = 0.95

?

Thursday, 15 April 2010

Page 15: 22 confidence

StepsIdentify distribution that connects estimator and true value.

Form confidence interval for known (sampling) distribution.

Write as probability statement.

Back transform.

Write as interval.

Thursday, 15 April 2010

Page 16: 22 confidence

X̄n − µ

σ/√

n∼ Z

Xi iid, and n large:

.

Thursday, 15 April 2010

Page 17: 22 confidence

(n− 1)S2

σ2∼ χ2(n− 1)

X̄n − µ

σ/√

n∼ Z

X̄n − µ

s/√

n∼ tn−1

Xi ∼ Normal(µ,σ2)iid

Thursday, 15 April 2010

Page 18: 22 confidence

x

dens

0.1

0.2

0.3

−3 −2 −1 0 1 2 3

df1215Inf

Thursday, 15 April 2010

Page 19: 22 confidence

Properties of the t-dist

Heavier tails compared to the normal distribution.

Practically, if n > 30, the t distribution is practically equivalent to the normal.

limn→∞

tn = Z

Thursday, 15 April 2010

Page 20: 22 confidence

t-tablesBasically the same as the standard normal. But one table for each value of degrees of freedom.

Easiest to use calculator or computer: http://www.stat.tamu.edu/~west/applets/tdemo.html

(For homework, use this applet, for final, I’ll give you a small table, if necessary)

Thursday, 15 April 2010

Page 21: 22 confidence

Thursday, 15 April 2010

Page 22: 22 confidence

Your turnWe perform the experiment an experiment to measure the speed of sound and repeat it 10 times: 340 333 334 332 333 336 350 348 331 344 (mean: 338, sd: 7.01)

Assuming Xi ~ Normal(μ, σ2), what is an estimate of the speed of sound? What is the error (sd) of this estimate? Give an interval that we’re 95% certain the true speed of sound lies in.

Thursday, 15 April 2010

Page 23: 22 confidence

Example

340 333 334 332 333 336 350 348 331 344 (mean: 338, sd: 7.01)

If not known: (333, 342) (2.23)

Thursday, 15 April 2010

Page 24: 22 confidence

StepsIdentify distribution that connects estimator and true value.

Form confidence interval for known (sampling) distribution.

Write as probability statement.

Back transform.

Write as interval.

Thursday, 15 April 2010

Page 25: 22 confidence

Steps

Want P(a < Q < b) = 1 - α, and b - a to be as small as possible.

If Q is symmetric, P(-a < Q < a) = 1 - α. So a = F(α/2), and there is no interval smaller.

If Q isn’t symmetric, pick a = F(α/2), b = F(1 - α/2), but there might be a shorter interval.

Thursday, 15 April 2010

Page 26: 22 confidence

Example

We want a 90% confidence interval, then two possible ends for the interval are F(0.05) and F(0.95)

Thursday, 15 April 2010

Page 27: 22 confidence

Reading

Read the rest of chapter 6.

Everything else is just examples of the general method we learned today.

Thursday, 15 April 2010