Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- teoremaCentralLimite.chisq=function(n, N=1000, titulo="Histograma chisq(1000,1)", yl=c(0, .4)) { ## início da função
- medias=numeric(N)
- for (i in 1:N) medias[i]= mean(rchisq(n,1/3))
- hist(medias, xlim=c(-1,10), ylim=yl, freq=F, main=titulo)
- x=seq(-1,10, .02)
- points(x, dnorm(x, 3, 3*sqrt(1/n) ), type="l", lwd=3)
- } ## fim da função
- graphics.off()
- par(mfrow=c(3,3), mai=c(.3,.4,.1,.1))
- teoremaCentralLimite.chisq(5,titulo="n=5")
- teoremaCentralLimite.chisq(15,titulo="n=15")
- teoremaCentralLimite.chisq(25,titulo="n=25")
- teoremaCentralLimite.chisq(100,titulo="n=100")
- teoremaCentralLimite.chisq(1000,titulo="n=1000")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement