Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = 10/runif(10^5)^.5
- pm = sample(c(-1,1),10^5, rep=T)
- y = x*pm
- hist(y[abs(y) < 100], prob=T, br=50)
- x1 = rexp(10^5, 1); x2 = rexp(10^5, 1)
- y = x1 - x2
- mean(y); var(y)
- [1] 0.006819823
- [1] 1.989892
- hist(y, prob=T, br=50, col="skyblue2")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement