




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





STAT 703/J703 B.Habing Univ. of SC (^1)
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
STAT 703/J703 B.Habing Univ. of SC (^3)
Recall that the definition of the cumulative distribution function (CDF) is:
Note that:
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
1
STAT 703/J703 B.Habing Univ. of SC (^12)
This leads directly to the fact that
With more theory we could prove that
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
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
3.95 3.79 3.75 2.71 5. 6.12 1.74 6.05 3.92 5.
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?