r - Bootstrap and sample mean -
r - Bootstrap and sample mean -
i have sample exponential distribution, let's x<-rexp(30,0.2)
.
i resample 5000 times replacement , compute sample mean:
resample<-replicate(5000,mean(sample(x,30,replace=true)))
i next histogram see distribution of t(x*)-t(x): hist(resample-mean(x),freq=false)
i know since have sequence of iid exponentials, sum of sequence has gamma distribution (scaled number of exponential rv's i'm considering (i.e., 30)).
how can overlay gamma distribution previous histogram? i'm trying utilize next res.range<-seq(min(resample),max(resample),.001) lines(res.range, dgamma(res.range,shape=1,rate=0.2/30))
seems doesn't work.
r statistics statistics-bootstrap
Comments
Post a Comment