Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n <- 100000 #number of simulations
- U <- runif(n) #Uniform simulations
- X <- -log(log(1/U)) #create X as inverse cdf
- hist(X, breaks= 100, freq = FALSE) #make histogram
- Y <- seq(-3,8, length.out = length(X))
- lines(Y, exp(-Y-exp(-Y)), col = "red") #plot theoretic density
Add Comment
Please, Sign In to add comment