本文根据Bail et al.的著作Empirical Asset Pricing编写相关程序,投资组合分析的模块是EAP.fama_macbeth,下面将对该模块进行详细介绍。本文的Package已发布于Github:
Github: GitHub - whyecofiliter/EAP: empirical asset pricing
Fama-Macbeth回归检验因子风险溢价的存在性。Fama Macbeth回归遵循两个步骤:
1.指定模型并进行横截面回归。
2.取回归系数的时间序列平均值
欲知更多详情,请阅读Empirical Asset Pricing: The Cross Section of Stock Returns. Bali, Engle, Murray, 2016.
检验特征对资产收益率是否具有系统性影响,需要在FM回归模型中加入股票特征。在本demo中,特征或因子包括规模、价值、盈利能力、投资、动量和换手率,其代理变量在模拟因素的投资组合demo中介绍。
# %% set system path
import sys,os
sys.path.append(os.path.abspath(".."))
数据预处理
# %% import data
# Monthly return of stocks in China securit