Skip to content

Instantly share code, notes, and snippets.

@stjordanis
Forked from ericnovik/pit.R
Created October 2, 2018 19:54
Show Gist options
  • Save stjordanis/3faccb83b101d2b9b5ebd97fe3d6ec07 to your computer and use it in GitHub Desktop.
Save stjordanis/3faccb83b101d2b9b5ebd97fe3d6ec07 to your computer and use it in GitHub Desktop.
library(cowplot)
n <- 1e4
X <- rlogis(n)
Y <- plogis(X)
plot_dens <- function(data, ...) {
qplot(
data,
geom = "histogram",
alpha = I(1 / 2),
...
) + xlab("")
}
pl <- plot_dens(X) + ggtitle("Logistic Distribution")
pu <- plot_dens(Y) + ggtitle("Uniform from Logistic")
plot_grid(pl, pu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment