Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. mu<-14
  2. sigma<-4
  3. sampsz<-10
  4. nsimulations<-1000
  5. mu.estimates<-numeric(nsimulations)
  6. var.estimates<-numeric(nsimulations)
  7. for(i in 1:nsimulations) {
  8. rn<-rnorm(mean=mu,sd=sigma,n=sampsz)
  9. mu.estimates[i]<-mean(rn)
  10. var.estimates[i]<-mean((rn-mean(rn))^2)
  11. }
  12. plot(density(mu.estimates))
  13. plot(density(var.estimates))
  14. max<-a[1]
  15. i<-2
  16. for(i in n){
  17. if (a[i]>max){
  18. max<-a[i]
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement