Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = 10^5; u = runif(m); x = numeric(m)
- for(i in 1:m) { x[i] = u[i] - runif(1, 0, u[i]) } # define each x in terms of u
- cor(x,u); plot(u, x, pch=".")
- ## 0.6546795 # x and u highly correlated
- plot(u, x, pch=".")
- hist(x, prob=T, col="skyblue2")
Add Comment
Please, Sign In to add comment