Session Ready
Exercise

The minimum variance and maximum Sharpe ratio portfolio

In the previous exercises, you computed the efficient frontier using a grid of target returns. The output of your calculation of the efficient frontier was a series of two vectors, vpm (vector of portfolio means), and vpsd (vector of standard deviations, or volatilities), and a matrix of weights called mweights. You will use these outputs to identify the portfolios with the least volatility, and the greatest Sharpe ratio, and then plot their weight allocation.

As a reminder, the Sharpe Ratio is found by taking the excess returns less than the risk-free rate, divided by the portfolio volatility.

Instructions
100 XP
  • Create weights_minvar, which is the row in mweights where the standard deviation in minimized (vpsd == min(vpsd)).
  • Calculate the Sharpe ratio of portfolio returns when the risk-free rate is 0.75%. Call this vsr.
  • Create weights_max_sr as the row in mweights corresponding to the portfolio with the maximum Sharpe ratio in vsr. This can be solved in a similar fashion as the first instruction.
  • Create a bar plot of the weights that are greater than 1% in the weights_minvar portfolio, and create a bar plot of the weights that are greater than 1% in the weights_max_sr portfolio.