Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.33 KB | None | 0 0
  1. y = rgamma(1000,2,1)
  2. x = runif(1000,0,y)
  3.  
  4. par(mfrow=c(1,1))
  5. plot(x,y)
  6.  
  7. mean(x<1 & y<2)
  8. mean(x<1 & y<0.5)
  9.  
  10. sum(y < x^2)/1000
  11.  
  12. mean(x)
  13. mean(y)
  14.  
  15. cov(x,y)
  16. cor(x,y)
  17.  
  18. mean(y-x)
  19. var(y-x)
  20.  
  21. par(mfrow=c(1,2))
  22. plot(x,y, main="Theoretical")
  23. lines(y=x+1, x=x, col="red")
  24.  
  25. plot(x,y, main="Lowess")
  26. lines(lowess(x,y),col="red")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement