金融决策科学中,零数理统计的应用原理是什么?
- 内容介绍
- 文章标签
- 相关推荐
本文共计7751个文字,预计阅读时间需要32分钟。
相关专题
以下模拟之:
# https://github.com/sijichun/MathStatsCode/blob/master/notebook_python/LLN_CLT.ipynbimport numpy as npfrom numpy import random as nprd True_P=0.5def sampling(N): ## 产生Bernouli样本 x=nprd.rand(N)<True_P return x M=10000 #模拟次数xbar=np.zeros(M) N=np.array([i+1 for i in range(M)]) x=sampling(M)for i in range(M): if i==0: xbar[i]=x[i] else: xbar[i]=(x[i]+xbar[i-1]*i)/(i+1)## 导入matplotlibimport matplotlib.pyplot as plt ## 使图形直接插入到jupyter中%matplotlib inline# 设定图像大小plt.rcParams['figure.figsize'] = (10.0, 8.0) plt.plot(N,xbar,label=r'$ar{x}$',color='pink') ## xbarxtrue=np.ones(M)*True_P plt.plot(N,xtrue,label=r'$0.5$',color='black') ## true xbarplt.xlabel('N') plt.ylabel(r'$ar{x}$') plt.legend(loc='upper right', frameon=True) plt.show() ## 画图
简单来说,大数定律讲的是,样本容量极大时,样本的均值必然趋近于总体的期望。
本文共计7751个文字,预计阅读时间需要32分钟。
相关专题
以下模拟之:
# https://github.com/sijichun/MathStatsCode/blob/master/notebook_python/LLN_CLT.ipynbimport numpy as npfrom numpy import random as nprd True_P=0.5def sampling(N): ## 产生Bernouli样本 x=nprd.rand(N)<True_P return x M=10000 #模拟次数xbar=np.zeros(M) N=np.array([i+1 for i in range(M)]) x=sampling(M)for i in range(M): if i==0: xbar[i]=x[i] else: xbar[i]=(x[i]+xbar[i-1]*i)/(i+1)## 导入matplotlibimport matplotlib.pyplot as plt ## 使图形直接插入到jupyter中%matplotlib inline# 设定图像大小plt.rcParams['figure.figsize'] = (10.0, 8.0) plt.plot(N,xbar,label=r'$ar{x}$',color='pink') ## xbarxtrue=np.ones(M)*True_P plt.plot(N,xtrue,label=r'$0.5$',color='black') ## true xbarplt.xlabel('N') plt.ylabel(r'$ar{x}$') plt.legend(loc='upper right', frameon=True) plt.show() ## 画图
简单来说,大数定律讲的是,样本容量极大时,样本的均值必然趋近于总体的期望。

