開始使用免費開始

每月平均與波動度

你已經建立了 S&P 500 的逐月報酬。接下來,你需要對這些報酬做描述性分析。

在本練習中,你會計算報酬的算術與幾何平均數,以及「波動度」(標準差)。這些報酬已以變數 sp500_returns 提供在你的工作空間中。

本練習屬於課程

R 投資組合分析入門

檢視課程

練習說明

  • 計算此報酬時間序列的算術平均數。
  • 使用 mean.geometric() 計算此報酬時間序列的幾何平均數。
  • 計算此報酬時間序列的標準差。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Compute the mean monthly returns


# Compute the geometric mean of monthly returns


# Compute the standard deviation

編輯並執行程式碼