Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- qexp(.5, lam); 10*log(2)
- [1] 6.931472
- [1] 6.931472
- set.seed(1234) # for reproducibility
- m = 10^6; n = 5; lam = .1
- x = rexp(m*n, lam)
- MAT = matrix(x, nrow=m) # m by n matrix each row a sample
- a = rowMeans(MAT) # vector of m mean
- h = apply(MAT,1,median) # vector of m medians
- mean(a); sd(a)
- [1] 10.00473
- [1] 4.479718
- mean(h); sd(h)
- [1] 7.833585
- [1] 4.625242
- est.h = log(2)*a
- mean(est.h); sd(est.h)
- [1] 6.934753 # aprx mean of MLE = 6.9315
- [1] 3.105104 # SD(MLE) < 4.625242
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement