Guest User

Untitled

a guest
Aug 14th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. u = runif(2); y = sum(-log(u)/.2)
  2.  
  3. n = 2; m = 10^4; lam = .2
  4. y = replicate(m, sum(-log(runif(2))/lam))
  5. hdr = "Simulated Dist'n of GAMMA(2, .2) with PDF"
  6. hist(y, br=40, prob=T, col="skyblue2", main=hdr)
  7. curve(lam^2*x*exp(-lam*x), 0, 80, add=T, lwd=2, col="blue")
  8. abline(h=0, col="green3"); abline(v=0, col="green3")
Add Comment
Please, Sign In to add comment