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

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -