Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mu<-14
- sigma<-4
- sampsz<-10
- nsimulations<-1000
- mu.estimates<-numeric(nsimulations)
- var.estimates<-numeric(nsimulations)
- for(i in 1:nsimulations) {
- rn<-rnorm(mean=mu,sd=sigma,n=sampsz)
- mu.estimates[i]<-mean(rn)
- var.estimates[i]<-mean((rn-mean(rn))^2)
- }
- plot(density(mu.estimates))
- plot(density(var.estimates))
- max<-a[1]
- i<-2
- for(i in n){
- if (a[i]>max){
- max<-a[i]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement