[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.11774773 [View]
File: 84 KB, 1366x768, 2020-06-08.png [View same] [iqdb] [saucenao] [google]
11774773

i try to learn about Central Limit Theorem using python. I have list of 24000 bitcoin prices, i take lot of samples, then take their means, after that i plot density plot. It looks bit like normal distribution, but not quite pic related, why? I am testing on 1000000 means from samples of length 100

here is code

import seaborn as sns
from matplotlib import pyplot as plt
from random import randint
from statistics import mean

def getMeans(n, sample_length,prices=prices):
samples=[]
for i in range(n):
print(i)
piv=randint(0,len(prices)-(sample_length+1))
samples.append(mean(prices[piv:piv+sample_length]))
return samples

samples=getSamples(1000000,100)
sns.distplot(samples)
plt.show()

Navigation
View posts[+24][+48][+96]