一只股票每日预期收益为0.1%,每日波动率为0.5%,求100日后的预期综合收益。

changes=pd.DataFrame(np.random.normal(loc=0.1,scale=0.25,size=(100,10)))
#10条数据,每条100行,均值为0.1,标准差0.25
print(changes.head())
returns=changes.cumsum(0)
print(returns.head())
returns.plot()
plt.show()

模拟出的随机股票收益率

随机股票收益率之和

随机股票模拟收益率之和的可视化图片


posted on 2017-11-21 10:04  小菜鸟成长之路  阅读(893)  评论(0编辑  收藏  举报