Pythonで学ぶモンテカルロ・シミュレーション
Izzy Weber
Curriculum Manager, DataCamp
「平均(loc)を中心とする鐘形。幅は標準偏差(scale)で決まる」
米国成人男性の身長は正規分布に従います:




米国成人男性の身長は正規分布:平均 177 cm、標準偏差 8 cm
身長が190 cm超または165 cm未満の割合は?
heights = st.norm.rvs(loc=177, scale=8, size=10000)qualified = (heights < 165) | (heights > 190)print(np.sum(qualified) * 100/10000)
12.28
heights_dict = {"heights":heights}
sns.histplot(x="heights", data=heights_dict)
plt.axvline(x=165, color="red")
plt.axvline(x=190, color="red")

st.uniform)st.expon)Pythonで学ぶモンテカルロ・シミュレーション