Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- u = runif(2); y = sum(-log(u)/.2)
- n = 2; m = 10^4; lam = .2
- y = replicate(m, sum(-log(runif(2))/lam))
- hdr = "Simulated Dist'n of GAMMA(2, .2) with PDF"
- hist(y, br=40, prob=T, col="skyblue2", main=hdr)
- curve(lam^2*x*exp(-lam*x), 0, 80, add=T, lwd=2, col="blue")
- abline(h=0, col="green3"); abline(v=0, col="green3")
Add Comment
Please, Sign In to add comment