Top Banner
1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University [email protected] http:// tigpbp.iis.sinica.edu.tw/courses.htm
59

1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University [email protected] .

Jan 01, 2016

Download

Documents

Arnold Davidson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

1

Nonparametric Methods II

Henry Horng-Shing LuInstitute of Statistics

National Chiao Tung [email protected]

http://tigpbp.iis.sinica.edu.tw/courses.htm

Page 2: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

2

PART 3: Statistical Inference by Bootstrap Methods

References Pros and Cons Bootstrap Confidence Intervals Bootstrap Tests

Page 3: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

3

References Efron, B. (1979). "Bootstrap Methods: Another

Look at the Jackknife". The Annals of Statistics 7 (1): 1–26.

Efron, B.; Tibshirani, R. (1993). An Introduction to the Bootstrap. Chapman & Hall/CRC.

Chernick, M. R. (1999). Bootstrap Methods, A practitioner's guide. Wiley Series in Probability and Statistics.

Page 4: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

4

Pros (1) In statistics, bootstrapping is a modern,

computer-intensive, general purpose approach to statistical inference, falling within a broader class of re-sampling methods.

http://en.wikipedia.org/wiki/Bootstrapping_(statistics)

Page 5: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

5

Pros (2) The advantage of bootstrapping over

analytical method is its great simplicity - it is straightforward to apply the bootstrap to derive estimates of standard errors and confidence intervals for complex estimators of complex parameters of the distribution, such as percentile points, proportions, odds ratio, and correlation coefficients.

http://en.wikipedia.org/wiki/Bootstrapping_(statistics)

Page 6: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

6

Cons The disadvantage of bootstrapping is that whil

e (under some conditions) it is asymptotically consistent, it does not provide general finite sample guarantees, and has a tendency to be overly optimistic.

http://en.wikipedia.org/wiki/Bootstrapping_(statistics)

Page 7: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

7

How many bootstrap samples is enough?

As a general guideline, 1000 samples is often enough for a first look. However, if the results really matter, as many samples as is reasonable given available computing power and time should be used.

http://en.wikipedia.org/wiki/Bootstrapping_(statistics)

Page 8: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

8

Bootstrap Confidence Intervals1. A Simple Method2. Transformation Methods

2.1. The Percentile Method2.2. The BC Percentile Method2.3. The BCa Percentile Method2.4. The ABC Method (See the book: An Introductio

n to the Bootstrap.)

Page 9: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

9

1. A Simple Method Methodology Flowchart R codes C codes

Page 10: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

10

Normal Distributions

2 21 2

2

1/ 2 / 2 / 2

/ 2 / 2

, , ..., ~ ( , ), is known.

ˆˆ ~ ( , ), ~ (0, 1).

( ) 1 (1 / 2)/

ˆ ˆ( / / ) 1

iid

n

LCL UCL

X X X N

X N Z Nn n

P z z where Zn

P z n z n

Page 11: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

11

1 2

/ 2 / 2ˆ

ˆ ˆ/ 2 / 2

More generally,

, , ..., ~ ( ).

ˆLet , then

ˆ(0, 1).

ˆ. .( )

ˆ( ) 1

ˆ ˆ( ) 1

iid

n

n

n

X X X F x

MLE

Pivot Ns e

P z z

P z z

Asymptotic C. I. for The MLE

http://en.wikipedia.org/wiki/Pivotal_quantity

Page 12: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

12

When is not large, we can construct

more precise confidence intervals

by bootstrap methods for many statistics

including the and others.

n

MLE

Bootstrap Confidence Intervals

Page 13: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

13

*1

* * **

( ) (1 )2 2

Theorem in Gill (1989): Under regular conditions,

ˆn ( ( )) ( ) ,

ˆ ˆn ( ) ,..., ( ) .

Want 1

ˆ ˆ ˆ ˆ ˆ ˆNote that 1

on

on n

F d F B F

X X d F B F

P LCL UCL

P

* *

( ) (1 )2 2

* *

(1 ) ( )2 2

ˆ ˆ ˆ ˆ ˆ

ˆ ˆ ˆ ˆ 2 2

.

P

P

P LCL UCL

Simple Methods

Page 14: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

14

11 2 101

1(1) (2) (101) (51)

1 2 101

* * *(1) (2) (101)

* * 1 *(51)

1, , ..., ~ ( , 1), = ( ).

21ˆ ... , ( ) .2

Resampling with replacement from , , ..., .

... .

1ˆ ( ) .2

Repeat 1000

n

n

X X X N median F

X X X F X

X X X

X X X

F X

B

* * *(1) (2) (1000)

times,

ˆ ˆ ˆwe can get ... .

An Example by The Simple Method (1)

Page 15: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

15

* * ** (25) (975)

* * ** (25) (975)

* *(25) (975)

* *(975) (25)

* *(975) (25)

ˆ ˆ ˆ 1 95%

ˆ ˆ ˆ ˆ ˆ ˆ

ˆ ˆ ˆ ˆ ˆ

ˆ ˆ ˆ ˆ2 2 .

ˆ ˆ ˆ ˆ[ 2 , 2 ]

is an approximate (1- ) confidence in

P

P

P

P

LCL UCL

terval for .

*(1)̂ *

(1000)̂*(25)̂ *

(975)̂

95%

An Example by The Simple Method (2)

Page 16: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

16

Flowchart of The Simple Method

*2x

*Bx

*(2)̂

1 2ˆ ( , , ..., ) ( )ndata x x x s x x

* *ˆget resample statistics ( ) and then sort themb bs x

*1x

resample B times

*(1)̂

100(1 )% confidence interval

1 2[( 1) / 2], [( 1)(1 / 2)]v B v B

2 1

* *( ) ( )

ˆ ˆ ˆ ˆ2 , 2v vLCL UCL

*( )ˆ

B*(2)̂

Page 17: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

17

The Simple Method by R

Page 18: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

18

Page 19: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

19

resample B times:

* *ˆ ( )b bmean x

*bx

The Simple Method by C (1)

ˆ ( ) ( )a s x mean x

Page 20: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

20

The Simple Method by C (2)

calculate v1, v2

100(1 )% confidence interval

Page 21: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

21

Page 22: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

22

Page 23: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

23

Page 24: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

24

2. Transformation Methods 2.1. The Percentile Method 2.2. The BC Percentile Method 2.3. The BCa Percentile Method

Page 25: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

25

2.1. The Percentile Method Methodology Flowchart R codes C codes

Page 26: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

26

The Percentile Method (1) The interval between the 2.5% and 97.5%

percentiles of the bootstrap distribution of a statistic is a 95% bootstrap percentile confidence interval for the corresponding parameter. Use this method when the bootstrap estimate of bias is small.

http://bcs.whfreeman.com/ips5e/content/cat_080/pdf/moore14.pdf

Page 27: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

27

1 1

ˆSuppose ~ ( ).

Then ( ) ~ .

( ) ~ ( ) ~ (0, 1).

Assume that there exists an unbiased

and (monotonly) increasing function ( )

ˆsuch that ( ) ( ) (0, 1).

Y H

H Y U

H Y U N

g

g g N

The Percentile Method (2)

Page 28: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

28

*

**

* 1 ** ([( 1)(1 )])

11

ˆIf ( ) ( ) (0, 1),

ˆ ˆthen ( ) ( ) (0, 1).

ˆ ˆ( ) ( ) 1

ˆ ˆ ˆ ˆ ( ( ) )) and

ˆ( ) ( )

ˆ ( ( ) )) (Note: for (0, 1

B

g g N

g g N

P g g z

P g g z

P g g z

P g g z z z N

1

1 *1 1 ([( 1) ])

).)

ˆ ˆ ˆ ( ( ) )) and .BP g g z

The Percentile Method (3)

Page 29: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

29

*([( 1)(1 )])

* *([( 1) /2]) ([( 1)(1 /2)])

ˆ, 1

ˆ ˆ 1 .

B

B B

Similarly P

and P

*([( 1) ])

*([( 1)(1 )])

* *([( 1) /2]) ([( 1)(1 /2)])

Summary of the percentile method:

ˆ 1 ,

ˆ 1 ,

ˆ ˆ 1 .

B

B

B B

P

P

P

The Percentile Method (4)

Page 30: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

30

Flowchart of The Percentile Method

*2x

*Bx

*(2)̂

1 2ˆ ( , , ..., ) ( )ndata x x x s x x

* *ˆget resample statistics ( ) and then sort themb bs x

*1x

resample B times

*(1)̂

100(1 )% confidence interval

1 2[( 1) / 2], [( 1)(1 / 2)]v B v B

1 2

* *( ) ( )ˆ ˆ,v vLCL UCL

*( )ˆ

B*(2)̂

Page 31: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

31

The Percentile Method by R

Page 32: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

32

Page 33: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

33

The Percentile Method by C

*bx

calculate v1, v2

100(1 )% confidence interval

resample B times:

* *ˆ ( )b bmean x

Page 34: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

34

Page 35: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

35

Page 36: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

36

Page 37: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

37

2.2. The BC Percentile Method Methodology Flowchart R code

Page 38: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

38

The BC Percentile Method Stands for the bias-corrected percentile meth

od. This is a special case of the BCa percentile method which will be explained more later.

Page 39: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

39

Flowchart of The BC Percentile Method

100(1 )% confidence interval

1 0 1 / 2

2 0 / 2

(2 )

(2 )

v z z

v z z

1 2

* *(( 1) ) (( 1) )ˆ ˆ,B v B vLCL UCL

0estimate z 1 *0

1

1 ˆ ˆestimate by 1B

bb

zB

*2x

*Bx

*(2)̂

1 2ˆ ( , , ..., ) ( )ndata x x x s x x

* *ˆget resample statistics ( ) and then sort themb bs x

*1x

resample B times

*(1)̂ *

( )ˆ

B*(2)̂

1( ) z

Page 40: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

40

The BC Percentile Method by R

Page 41: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

41

Page 42: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

42

2.3. The BCa Percentile Method Methodology Flowchart R code C code

Page 43: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

43

The BCa Percentile Method (1) The bootstrap bias-corrected accelerated (B

Ca) interval is a modification of the percentile method that adjusts the percentiles to correct for bias and skewness.

http://bcs.whfreeman.com/ips5e/content/cat_080/pdf/moore14.pdf

Page 44: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

44

1

**

* 0

* 1 ** 0 *

0

1 0

0

1

ˆ ˆ( ) ( )1

ˆ1 ( )

ˆ ˆ ˆ ˆ( ( ) (1 ( ))( ) ) .

ˆ( ) ( )1

1 ( )

ˆ( ) ( )( )1 ( )

ˆ ˆ( ( ) (1 ( ))(

g gP U z z

a g

P g g a g z z P

g gP U z z

a g

g z zP g

a z z

P g g a g z

1

1 1

2

1 2

0

*([( 1) (1 )])

*([( 1) (1 )])

* *([( 1) (1 )]) ([( 1) (1 )])

) ) .

ˆ ˆ .

ˆSimilarly, ( ) 1

ˆ ˆand ( ) 1 2 .

B

B

B B

z P

P

P

The BCa Percentile Method (2)

Page 45: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

45

1

1

1

1

1

00

0

0 00 1 0

0 0

02 0

0

?

1 ( )

ˆ( ) ( ) ˆ ˆand ( ) (1 ( )( ))1 ( )

and 1 ( )1 ( ) 1 ( )

Similarly, 1 ( ).1 ( )

P Z

g z zg a g z z

a z z

z z z zz z P Z z

a z z a z z

z zP Z z

a z z

The BCa Percentile Method (3)

Page 46: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

46

0

* ** *

*

* 0 0

0

1 *0 *

1 *0

1

?

ˆ ˆ ˆ ˆ( ) ( ) ( )

ˆ ˆ ˆ ˆ( ) ( ) ( ) ( )

ˆ ˆ1 ( ) 1 ( )

( )

ˆ ˆ( ) and

1 ˆ ˆˆ 1 .B

bb

z

P P g g

g g g gP z z

a g a g

z

z P

zB

The BCa Percentile Method (4)

Page 47: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

47

3( ) ( )

1

2 3/ 2( ) ( )

1

( ) 1, 1

?

ˆ ˆ( )ˆ ,

ˆ ˆ6 ( ( ) )

ˆwhere ( ) ({ , ...,

n

ii

Jack n

ii

i n i i

a

a

F X X

n

( ) ( )1

, ..., })

1ˆ ˆ .n

ii

X

andn

The BCa Percentile Method (5)

Page 48: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

48

Flowchart of The BCa Percentile Method

/ 2 0 1 / 2 01 0 2 0

/ 2 0 1 / 2 0

1 ( ), 1 ( )1 ( ) 1 ( )

z z z zz z

a z z a z z

100(1 )% confidence interval1 2

* *(( 1) (1 )) (( 1) (1 ))ˆ ˆ,B BLCL UCL

0estimate , z a

*2x

*Bx

*(2)̂

1 2ˆ ( , , ..., ) ( )ndata x x x s x x

* *ˆget resample statistics ( ) and then sort themb bs x

*1x

resample B times

*(1)̂ *

( )ˆ

B*(2)̂

1 *0

1

1 ˆ ˆestimate by 1 and by JackknifeB

bb

z aB

1( ) z

Page 49: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

49

Step 1: Install the library

of bootstrap in R.Step 2: If you want to check

BCa, type “?bcanon”.

Page 50: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

50

Page 51: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

51

The BCa Percentile Method by R

Page 52: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

52

Page 53: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

53

The BCa Percentile Method by C

Page 54: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

54

Page 55: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

55

Page 56: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

56

Page 57: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

57

Page 58: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

58

Page 59: 1 Nonparametric Methods II Henry Horng-Shing Lu Institute of Statistics National Chiao Tung University hslu@stat.nctu.edu.tw .

59

Exercises Write your own programs similar to those

examples presented in this talk.

Write programs for those examples mentioned at the reference web pages.

Write programs for the other examples that you know.

Prove those theoretical statements in this talk.

59