計算偏度與峰度
你剛剛看過 S&P500 資料的直方圖。現在把圖像化為數字,計算偏度與峰度。為了更完整地了解此分配,你也會查看平均數與標準差。提供的 S&P500 報酬資料在 returns_sp500,這就是你所需要的一切。
本練習屬於課程
Python 投資組合分析入門
練習說明
- 計算平均數與標準差。
- 計算偏度。
- 計算峰度。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Print the mean
print("mean : ", returns_sp500.____()*100)
# Print the standard deviation
print("Std. dev : ", returns_sp500.____()*100)
# Print the skewness
print("skew : ", returns_sp500.____())
# Print the kurtosis
print("kurt : ", returns_sp500.____())