Skip to content

Instantly share code, notes, and snippets.

@keithmcnulty
Created June 10, 2021 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithmcnulty/93f21b1e7203bdc342145986b7daa3ba to your computer and use it in GitHub Desktop.
Save keithmcnulty/93f21b1e7203bdc342145986b7daa3ba to your computer and use it in GitHub Desktop.
Multiplicative process distribution
library(ggplot2)
set.seed(123)
mult <- replicate(10000, prod(1 + runif(10)))
ggplot() +
geom_histogram(aes(x = mult, y = ..density..), fill = "lightblue") +
geom_density(aes(x = mult), fill = "pink", alpha = 0.4) +
theme_minimal() +
labs(x = "Product")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment