SML plots the results of the Capital Asset Pricing Model (CAPM) formula. The x-axis represents the risk (beta) and the y-axis represents the expected return. The market risk premium is determined by the slope of the SML.
Beta is one of the most important components to use the security market line. It is a numerical value that measures how a stock or security will move as the overall market rises or falls. It measures the systemic or non-diversible risk of an asset relative to a market portfolio.
Assume that the overall market average risk is a beta value of 1. Securities that are highly correlated with the market will have a beta greater than 1. Such securities fall into the high-risk category. On the other hand, securities with a beta less than 1 have a lower correlation to the market, less volatility or less risk.
Find beta of risky fund
beta = (r-r0)/(mu_M-r0)
print("beta of each risky fund:")
print(beta)
Define variables
# defining variables for plot
beta = beta
mu = r
beta_P0 = 0
mu_P0 = r0
beta_M = 1
mu_M = mu_M
mu_new = mu_new
beta_new = (mu_new-r0)/(mu_M-r0)
beta_SML = np.linspace(-0.25,2,100,endpoint=True)
mu_SML = r0 + beta_SML*(mu_M-r0)
# Plot
figure = plt.figure(figsize=(12, 7))
plt.plot(beta_SML,mu_SML,'b')
for i in range(5):
plt.plot(beta[i],mu[i],'ro',markersize=12)
plt.text(beta[i]+0.05,mu[i]-0.002,'P' + str(i+1))
plt.plot(beta_P0,mu_P0,'k8',label='Riskless Fund',markersize=12)
plt.plot(beta_M,mu_M,'gP',label='Tangency Port.',markersize=12)
plt.plot(beta_new,mu_new,'cP',label='New Optimal Port.',markersize=12)
plt.title('Overall Plot')
plt.xlabel(r'$\beta$')
plt.ylabel(r'Mean, $\mu$')
plt.legend()
plt.show()