LoslegenKostenlos loslegen

Optimal portfolio performance

Let's now continue with the efficient frontier ef that you calculated in a previous exercise for the small portfolio. You still need to select an optimal portfolio from that efficient frontier ef, and check its performance. Let's use the efficient_return option. This function selects the portfolio with the minimized risk given a target return. A portfolio manager is often asked to manage a portfolio under certain risk and return constraints, so this is a very useful function for that.

mu and Sigma are already calculated for you and ef is also available.

Diese Übung ist Teil des Kurses

Introduction to Portfolio Analysis in Python

Kurs anzeigen

Anleitung zur Übung

  • Obtain an efficient return portfolio, with a target return of 0.2. Store the weights of that portfolio under weights, then print and inspect the weights. Are there any stocks with zero weight?
  • Obtain the performance report for your efficient return portfolio.

Interaktive Übung

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

# Get the minimum risk portfolio for a target return 
weights = ef.____(____)
print (weights)

# Show portfolio performance 
ef.____(verbose=True)
Code bearbeiten und ausführen