linear factor model

  1. content
    Assume that the risk-free rate is 0.13% per month. Assume that the risk-free rate is 0.13% per month.
    (1) Regress the monthly realized excess returns for each of the ten industry portfolios on the monthly realized excess returns for the market portfolio, so as to estimate the intercept coefficient (alpha) and slope coefficient (beta) for each of the ten industry portfolios.
    (2) Calculate the mean return for each of the ten industry portfolios, as well as the market portfolio.
    (3) Regress the mean returns of the ten industry portfolios and the market portfolio on the corresponding betas (by construction, the market portfolio has beta of one). This will give you the slope and intercept of the SML.

  2. code

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

market=pd.read_excel('Market_Portfolio.xlsx',header=0,names=range(0,2))
industry=pd.read_excel('Industry_Portfolios.xlsx',header=0,names = range(0,11))

Rf=0.13
excess_market= np.array(market[1])-Rf
alpha=[]
beta=[]
for i in range(1,11):
    excess_asset=np.array(industry[i])-Rf
    reg=np.polyfit(excess_market,excess_asset,deg=1)
    alpha=alpha+[reg[1]]
    beta=beta+[reg[0]]

mean_industry=np.mean(industry,axis=0)
mean_industry=np.array(mean_industry[1:11])
mean_market=np.array(np.mean(market[1]))

beta=beta+[1]
mean_industry=np.hstack([mean_industry,mean_market])
reg1=np.polyfit(beta,mean_industry,deg=1)

#plot
fig=plt.figure()
plt.xlim(0,2)
plt.xlabel('beta')
plt.ylabel('R')
# scatter
plt.scatter(beta,mean_industry)
#market portfolio
plt.scatter(1,mean_market)
plt.plot([1,1],[0,mean_market],'k--')
plt.plot([0,1],[mean_market,mean_market],'k--')
plt.annotate(r'market potfolio', xy=(1, mean_market), xycoords='data', xytext=(+30, -30), textcoords='offset points', fontsize=12, 
             arrowprops=dict(arrowstyle='->',connectionstyle='arc3,rad=.2') ) 
#SML
x=np.linspace(0,2,100)
y=reg1[1]+reg1[0]*x
plt.plot(x,y,label='SML')
plt.legend()
plt.savefig('polyfit.png')
plt.show()

  1. result
    在这里插入图片描述

  2. analysis
    Analysis: (economic significance of alpha and beta) The expected return of any portfolios consists of two parts: alpha and beta:
    (1) Alpha has nothing to do with the whole market. It only depends on the portfolio itself. So, we call it unsystemic risk.
    (2) Beta represents degree of asset’s exposure to market risk. It considers as the systemic risk of a portfolio. When the market goes up, the contribution of this part to the portfolio is positive. When the market goes down, the return of portfolio declines proportionally with the market.

Analysis:
Analysis: (explain the economic significance of the SML)
(1) The securities market line provides a detailed description of the relationship between expected return and risk of securities portfolio. The expected return of any portfolios consists of two parts: one is risk-free rate and the other is [E(rp)-Rf].
(2) Risk-free rate can consider as compensation for the abandonment of immediate consumption.
(3) [E(rp)-Rf] is known as risk premium. It is proportional to the magnitude of risk that is due to beta. Risk premium represents the compensation for unit risk, as know as the price of risk.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值