MulaiMulai sekarang secara gratis

Annualized mean and volatility

The mean and volatility of monthly returns correspond to the average and standard deviation over a monthly investment horizon. Investors annualize those statistics to show the performance over an annual investment horizon.

To do so, the package PerformanceAnalytics has the function Return.annualized() and StdDev.annualized() to compute the (geometrically) annualized mean return and annualized standard deviation for you.

Remember that the Sharpe ratio is found by taking the mean excess returns subtracted by the risk-free rate, and then divided by the volatility! The packages PerformanceAnalytics and sp500_returns are preloaded for you.

Latihan ini adalah bagian dari kursus

Introduction to Portfolio Analysis in R

Lihat Kursus

Petunjuk latihan

  • Use the function Return.annualized() to compute the annualized mean of sp500_returns.
  • Use the function StdDev.annualized() to compute the annualized standard deviation of sp500_returns.
  • Calculate the annualized Sharpe Ratio using commands from the PerformanceAnalytics package, assign it to ann_sharpe. Assume the risk free rate is 0.
  • Obtain all the above results at once using the function table.AnnualizedReturns().

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Compute the annualized mean


# Compute the annualized standard deviation


# Compute the annualized Sharpe ratio: ann_sharpe
ann_sharpe <- 

# Compute all of the above at once using table.AnnualizedReturns()
Edit dan Jalankan Kode