March 2019
Beginner to intermediate
448 pages
13h 14m
English
We will generate two samples of 10,000 random numbers, the first one via the rnorm function, and the second one using the inverse transformation method.
rnorm_result = data.frame(rnorm = rnorm(10000,0,1))inverse_way = data.frame(inverse = qnorm(runif(10000),0,1))
total_table = cbind(rnorm_result,inverse_way)transp_table = gather(total_table)colnames(transp_table) = c("method","value")
ggplot(transp_table, aes(x=value,fill=method)) + geom_density(alpha=0.25)
Read now
Unlock full access