Guest User

Untitled

a guest
Dec 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. n <- 100000 #number of simulations
  2. U <- runif(n) #Uniform simulations
  3. X <- -log(log(1/U)) #create X as inverse cdf
  4. hist(X, breaks= 100, freq = FALSE) #make histogram
  5. Y <- seq(-3,8, length.out = length(X))
  6. lines(Y, exp(-Y-exp(-Y)), col = "red") #plot theoretic density
Add Comment
Please, Sign In to add comment