Docsity

Lecture Notes: Methods with CDF - Empirical Distribution, K-S Test, and Bootstrap, Study notes of Statistics

Toggle sidebar
bg1
1
STAT 703/J703 B.Habing Univ. of SC 1
STAT 703/J703
April 17th, 2007
-
Lecture 25-
Instructor: Brian Habing
Department of Statistics
LeConte 203
Telephone: 803-777-3578
STAT 703/J703 B.Habing Univ. of SC 2
Today
Methods Based on the CDF
• The Empirical Distribution Function
• Some Statistical Properties
• Kolmogorov-Smirnov Test
• The Nonparametric Bootstrap
STAT 703/J703 B.Habing Univ. of SC 3
Recall that the definition of the
cumulative distribution function
(CDF) is:
FX(
x
)=P(X≤
x
)
Note that:
•F
X(
x
) is non-decreasing
•F
X(
x
) →1 as
x
→∞
•F
X(
x
) →0 as
x
→-∞
pf3
pf4
pf5
pf8

Partial preview of the text

Download Lecture Notes: Methods with CDF - Empirical Distribution, K-S Test, and Bootstrap and more Study notes Statistics in PDF only on Docsity!

STAT 703/J703 B.Habing Univ. of SC (^1)

STAT 703/J

April 17 th^ , 2007

- Lecture 25-

Instructor: Brian Habing Department of Statistics LeConte 203 Telephone: 803-777- E-mail: [email protected]

STAT 703/J703 B.Habing Univ. of SC (^2)

Today

Methods Based on the CDF

  • The Empirical Distribution Function
  • Some Statistical Properties
  • Kolmogorov-Smirnov Test
  • The Nonparametric Bootstrap

STAT 703/J703 B.Habing Univ. of SC (^3)

Recall that the definition of the cumulative distribution function (CDF) is:

F X (x)=P(X≤x)

Note that:

• F X (x) is non-decreasing

• F X (x) →1 as x→∞

• F X (x) →0 as x→-∞

STAT 703/J703 B.Habing Univ. of SC (^4)

The advantage of the CDF is that every random variable has one, and it has the same definition for both discrete and continuous random variables.

STAT 703/J703 B.Habing Univ. of SC (^5)

x<-(-500:500)/ plot(x,pnorm(x),type="l")

STAT 703/J703 B.Habing Univ. of SC (^6)

plot(x,pbinom(x,5,.4),type="l")

STAT 703/J703 B.Habing Univ. of SC (^10)

edf(rnorm(10)) lines(x,pnorm(x))

STAT 703/J703 B.Habing Univ. of SC (^11)

Statistical properties of the EDF

Note that we could write the EDF as

=

−∞

n

i

n I x Xi

n

F x

1

( ,]( )

STAT 703/J703 B.Habing Univ. of SC (^12)

This leads directly to the fact that

F n(x ) →F(x ) as n→∞ for each x

With more theory we could prove that

supx |F n(x ) →F(x )| → 0 as n→∞

STAT 703/J703 B.Habing Univ. of SC (^13)

The Kolmogorov-Smirnov test uses this quantity to construct a test of the null hypothesis that the data is drawn from a population with cdf F.

The test statistic is

supx |F n(x ) →F(x )|

STAT 703/J703 B.Habing Univ. of SC (^14)

The command in R is ks.test

ks.test(x,"pnorm",0,1)

STAT 703/J703 B.Habing Univ. of SC (^15)

It is interesting that the distribution of the Kolmogorov-Smirnov statistic does not depend on F !!!

STAT 703/J703 B.Habing Univ. of SC (^19)

Example: Estimate the variance and bias of the sample standard

deviations for the sample:

3.95 3.79 3.75 2.71 5. 6.12 1.74 6.05 3.92 5.

Generated using x<-10*rbeta(10,3,4)

so the population has mean

30/7≈4.29 and variance

150/49 ≈3.06 (sd ≈ 1.75).

STAT 703/J703 B.Habing Univ. of SC (^20)

sdboot<-function(x,nboots=10000){ sampsize<-length(x) bootsamps<- matrix(sample(x,sampsizenboots, replace=T),ncol=sampsize) bootstats<-apply(bootsamps,1,sd) est.bias<-mean(bootstats)-sd(x) est.se<-sd(bootstats) c(est.bias,est.se) }*

STAT 703/J703 B.Habing Univ. of SC (^21)

How well does it work?

STAT 703/J703 B.Habing Univ. of SC (^22)

When can it have trouble?

  • Small sample sizes (but doesn’t everything?)
  • Statistic is not smooth