Get Started

The GMV portfolio

The global minimum volatility portfolio, or GMV portfolio, is the portfolio with the lowest standard deviation (risk) and the highest return for the given risk level.

Returns are very hard to predict, but volatilities and correlations tend to be more stable over time. This means that the GMV portfolio often outperforms the MSR portfolios out of sample even though the MSR would outperform quite significantly in-sample. Of course, out of sample results are what really matters in finance.

This is a part of the course

“Introduction to Portfolio Risk Management in Python”

View Course

Exercise instructions

  • Sort RandomPortfolios with the lowest volatility value, ranking in ascending order.
  • Multiply GMV_weights_array across the rows of StockReturns to get weighted stock returns.
  • Finally, review the plot of cumulative returns over time.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Sort the portfolios by volatility
sorted_portfolios = RandomPortfolios.sort_values(by=['____'], ascending=____)

# Extract the corresponding weights
GMV_weights = sorted_portfolios.iloc[0, 0:numstocks]

# Cast the GMV weights as a numpy array
GMV_weights_array = np.array(GMV_weights)

# Calculate the GMV portfolio returns
StockReturns['Portfolio_GMV'] = StockReturns.iloc[:, 0:numstocks].mul(____, axis=1).sum(axis=1)

# Plot the cumulative returns
cumulative_returns_plot(['Portfolio_EW', 'Portfolio_MCap', 'Portfolio_MSR', 'Portfolio_GMV'])

This exercise is part of the course

Introduction to Portfolio Risk Management in Python

IntermediateSkill Level
4.5+
11 reviews

Evaluate portfolio risk and returns, construct market-cap weighted equity portfolios and learn how to forecast and hedge market risk via scenario generation.

Level up your understanding of investing by constructing portfolios of assets to enhance your risk-adjusted returns.

Exercise 1: Portfolio composition and backtestingExercise 2: Calculating portfolio returnsExercise 3: Equal weighted portfoliosExercise 4: Market-cap weighted portfoliosExercise 5: Correlation and co-varianceExercise 6: The correlation matrixExercise 7: The co-variance matrixExercise 8: Portfolio standard deviationExercise 9: Markowitz portfoliosExercise 10: The efficient frontierExercise 11: Sharpe ratiosExercise 12: The MSR portfolioExercise 13: The GMV portfolio

What is DataCamp?

Learn the data skills you need online at your own pace—from non-coding essentials to data science and machine learning.

Start Learning for Free