Session Ready
Exercise

The tangency portfolio

Let us see how the weights of the underlying assets of the tangency portfolio depend on whether or not short positions are allowed.

Assume the risk-free rate is 0.005 (\(r_f\) = 0.5%) per month. The tangency portfolio can be found via:

$$\underset{t}{\text{max}} \ \mathrm{slope} = \frac{\mu_p - r_f}{\sigma_p} \text{, subject to}$$ $$\mu_p = t'\mu$$ $$\sigma_p = (t'\sum t)^{1/2}$$ $$t'1 = 1,$$

with \(\mu_p\) and \(\sigma_p\) the portfolio return and standard deviation respectively, \(t\) the vector of portfolio weights, \(\mu\) the vector of expected returns and \(\Sigma\) the covariance matrix of the returns.

If you add the condition that no short positions are allowed, the additional constraint that is to be added is \(x_i \geq\) for \(i = 1,\ldots,4\).

Luckily, the underlying arithmetics are encapsulated in the R function tangency.portfolio(). Again, smart use of these functions can make your work as a financial analyst considerably lighter.

Instructions
100 XP
  • Run the code. It assigns the monthly risk-free rate to t_bill_rate and uses the tangency.portfolio() function to calculate the efficient portfolio characteristics for both cases, that is, one where short sales is allowed, and one where short sales is not allowed. Study the generated plots that represent the weights of the stocks in both portfolios.