LoslegenKostenlos loslegen

Compute benchmark returns

In this exercise, we will create a benchmark to evaluate the performance of the optimization models in later exercises. An equal weight benchmark is a simple weighting scheme to construct the benchmark portfolio. The intuition of an equal weight approach is that there is no preference for any given asset. We are setting this up to answer the question, "Can optimization outperform a simple weighting scheme to construct a portfolio?"

Diese Übung ist Teil des Kurses

Intermediate Portfolio Analysis in R

Kurs anzeigen

Anleitung zur Übung

  • Load the PortfolioAnalytics package.
  • Load the edhec dataset.
  • Assign the edhec dataset to a variable named asset_returns.
  • Create a vector of equal weights assigned to a variable named equal_weights.
  • Compute an equal weight benchmark, rebalanced quarterly, of asset_returns.
  • Plot the benchmark returns.

Interaktive Übung

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


# Load the package


# Load the data


# Assign the data to a variable


# Create a vector of equal weights
equal_weights <- rep(1 / ncol(___), ncol(___))

# Compute the benchmark returns
r_benchmark <- Return.portfolio(R = ___, weights = ___, rebalance_on = ___)
colnames(r_benchmark) <- "benchmark"

# Plot the benchmark returns
Code bearbeiten und ausführen