Security market line

该文通过SML(证券市场线)展示了CAPM模型的结果,其中x轴表示风险(贝塔),y轴表示预期回报。贝塔衡量了资产相对于市场组合的系统性风险。文章计算了一个风险基金的贝塔值,并用Python绘制了SML图,包括风险基金、无风险基金、切点组合和新优化组合的位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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()

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值