Guest User

Untitled

a guest
Jan 9th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. m = 10^5; u = runif(m); x = numeric(m)
  2. for(i in 1:m) { x[i] = u[i] - runif(1, 0, u[i]) } # define each x in terms of u
  3. cor(x,u); plot(u, x, pch=".")
  4. ## 0.6546795 # x and u highly correlated
  5. plot(u, x, pch=".")
  6.  
  7. hist(x, prob=T, col="skyblue2")
Add Comment
Please, Sign In to add comment