Last active
February 4, 2022 18:08
-
-
Save dlakelan/315f85ea5436b5bcbcc195c241094f5d to your computer and use it in GitHub Desktop.
Sampling from non-normal distributions yields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# julia code to show that the mean of 14 samples from a 50/50 mixture | |
# of normal and uniform has extremely close to "normal" distribution | |
using Distributions, StatsPlots | |
meanvals = [mean([rand(Normal(0,1),7); rand(Uniform(-1,1),7)]) for i in 1:100000] | |
histogram(meanvals) | |
pop = [rand(Normal(0,1),10000); rand(Uniform(-1,1),10000)]; | |
histogram(pop) | |
expmeans = [mean(rand(Exponential(1.0),14)) for i in 1:100000] | |
histogram(expmeans) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the histogram of mean values from 14 exponentially distributed random variables.