LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Introduction to Portfolio Analysis in R

Kurs anzeigen

Anleitung zur Übung

  • 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().

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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()
Code bearbeiten und ausführen