LoslegenKostenlos loslegen

Out of sample performance evaluation

This example will illustrate how your returns can change based on the weighting created by an optimized portfolio. You will use the estimation portfolio (pf_estim) to evaluate the performance of your portfolio on the estimation sample of returns (returns_eval).

How severe is the optimality loss? Let's compare, for the portfolio weights in pf_estim, the performance you expected using the evaluation sample (returns_estim) with the actual return on the out-of-sample period (returns_eval).

pf_estim, returns_estim, and returns_eval are pre-loaded in your workspace.

Diese Übung ist Teil des Kurses

Introduction to Portfolio Analysis in R

Kurs anzeigen

Anleitung zur Übung

  • Calculate the returns of the portfolio with monthly rebalance weights pf_estim$pw on the estimation sample returns_estim. Call this returns_pf_estim.
  • Calculate the returns of the portfolio with monthly rebalance weights pf_estim$pw on the evaluation sample returns_eval. Call this returns_pf_eval.
  • Use the function table.AnnualizedReturns() on returns_pf_estim.
  • Use the function table.AnnualizedReturns() on returns_pf_eval. Compare the return, risk, and Sharpe ratio of these portfolios. The results from the pf_eval are what you may expect in a real performance.

Interaktive Übung

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

# Create returns_pf_estim
returns_pf_estim <- Return.portfolio(___, pf_estim$pw, rebalance_on = "months")


# Create returns_pf_eval


# Print a table for your estimation portfolio


# Print a table for your evaluation portfolio
 
Code bearbeiten und ausführen