一隻股票每日預期收益爲0.1%,每日波動率爲0.5%,求100往後的預期綜合收益。dom
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()
模擬出的隨機股票收益率
隨機股票收益率之和spa
隨機股票模擬收益率之和的可視化圖片orm