x <- rexp(100, rate = 1) sum(x) ------------------------------------- s <- 1:100 for(k in 1:100) { s[k] <- sum(rexp(100, rate = 1)) } s mean(s) sd(s) hist(s) hist(s,20) qqnorm(s) z <- (s-mean(s))/sd(s) hist(z,20) -------------------------------------- m.hat <- s/100 plot(m.hat) hist(m.hat,20) sm<-1:100 for(k in 1:100) { sm[k] <- sum(rexp(1000, rate = 1)) } m.hatm <- sm/1000 plot(m.hatm) hist(m.hatm,20) hist(m.hat,20) hist(m.hatm,20) --------------------------------------- mu.n<-1:1000 x<-rexp(1000, rate = 1) for(k in 1:1000) { mu.n[k] <- sum(x[1:k])/k } plot(mu.n) ----------------------------------------------- y.n<-1:1000 x<-rexp(1000, rate = 1) for(k in 1:1000) { y.n[k] <- sum(x[1:k])-k } plot(y.n)