Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. set.seed(1234) # for reproducibility
  2. B = 10^6; th = 6
  3. x1 = runif(B, 0, th); x2 = runif(B, 0, th)
  4. m = pmax(x1, x2); t2 = 1.5*m
  5. mean(m); mean(t2); var(t2)
  6. [1] 4.000053 # aprx E(M) = 4
  7. [1] 6.000079 # aprx E(T2) = 6 (unbiased)
  8. [1] 4.506313 # aprx Var(T2) < Var(T1)
  9. t1 = x1 + x2
  10. mean(x1); mean(t1); var(t1)
  11. [1] 2.998866 # a[rx E(X1) = 3
  12. [1] 5.998 # a[rx E(T1) = 6
  13. [1] 5.999963 # a[rx Var(T1) = 2(36)/12 = 6 > Var(T2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement