통계량의 확률분포이다.
통계량: 표본평균, 표본분산 등
import numpy as np
import matplotlib as plt
import random
# 평균 10, 분산 3, n의 갯수 10
xbars = [np.mean(np.random.normal(loc=10, scale=3, size=10)) for i in range(10000)]
h=plt.pyplot.hist(xbars, range=(5,15), bins=30)
모집단이 표본분포가 아닐 때 사용할 수 있는 표본 분포
0 ~ 10에서 n개 뽑아 평균을 낸 것의 분포
import random
import numpy as np
import matplotlib as plt
xbars = [np.mean(np.random.rand(n) * 10) for i in range(10000)]
h=plt.pyplot.hist(xbars, range=(0,10), bins=100)
지수분포에서 똑같이 구해보면,
import random
import numpy as np
import matplotlib as plt
n=1
xbars = [np.mean(np.random.exponential(scale=3, size=n)) for i in range(10000)]
print(np.mean(xbars), np.var(xbars))
h=plt.pyplot.hist(xbars, range=(0,10), bins=100)