Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Confidence Interval Lecture

I was going through the confidence interval lecture and was doing the exercise where we sample from the exponential distribution and check to see if the sample means would be normally distributed. Based on the Central Limit Theorem we should know that this is true for a large n, however, when running the jarque bera test I rarely get the case that the underlying distribution is normal.

Is this because jarque bera is much more strict as to what "normal distribution" is? Compared to the CLT which just states the sample means distribution would be approximately normal?

This is my code:

n = 10000  
expo_samples = [np.mean(np.random.exponential(POPULATION_MU, sample_size)) for i in range(n)]

#Your code goes here

plt.hist(expo_samples, 10)

_, pvalue, _, _ = jarque_bera(expo_samples)

print pvalue  
if pvalue > 0.05:  
    print 'The distribution of sample means is likely normal, despite the underlying distribution being non-normal (exponential).'  
else:  
    print 'The distribution of sample means is likely not normal.'  
jarque_bera(expo_samples)