Skip to content

Instantly share code, notes, and snippets.

@keithmcnulty
Created June 10, 2021 12:00
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/0c3883478442118e308bf5b5a9e83b4e to your computer and use it in GitHub Desktop.
Save keithmcnulty/0c3883478442118e308bf5b5a9e83b4e to your computer and use it in GitHub Desktop.
Log Multiplicative Process Distribution
library(ggplot2)
set.seed(123)
mult <- replicate(10000, prod(1 + runif(10)))
ggplot() +
geom_histogram(aes(x = log(mult), y = ..density..), fill = "lightblue") +
geom_density(aes(x = log(mult)), fill = "pink", alpha = 0.4) +
theme_minimal() +
labs(x = "Log of Product")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment