# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- save_plots = T set.seed(0) library(stats) # Chapter 5: Exercise 44 # if( save_plots ){ postscript("../../WriteUp/Graphics/Chapter5/ex_44.eps", onefile=FALSE, horizontal=FALSE) } old_par = par(mfrow=c(2,2)) alpha = 2 beta = 5 n_replications = 500 for( n in c(5,10,20,30 ) ){ data = rweibull( n_replications*n, alpha, beta ) WD = matrix( data=data, nrow=n_replications, ncol=n ) hist( colMeans( WD ), freq=F, main=sprintf('n=%d', n) ) } par(old_par) if( save_plots ){ dev.off() }