实证资产定价(Empirical asset pricing)已经发布于Github和Pypi. 包的具体用法(Documentation)博主将会陆续在CSDN中详细介绍,也可以通过Pypi直接查看。
Pypi: pip install --upgrade EAP
HomePage: EAP · Empirical Asset Pricing
Github: GitHub - whyecofiliter/EAP: empirical asset pricing
欢迎点赞、收藏、转发三连击!!!
————————————————
Fama-Macbeth 回归是实证资产定价中常用的实证方法。它用于验证因子是否具有显著的风险回报,具体内容可见实证资产系列文章中的Fama-Macbeth回归介绍。
我们添加了对回归得到的风险回报的图形化显示功能。具体函数为
def plot(self, figsize=(14, 7), together=False, window=None, select=None, **kwargs):
This function plots the regression slopes of the FM regression.
input :
figsize (tuple) : Figsize.
together (boolean) : Whether print the slope in one figure.
window (int) : The window of moving average slopes.
select (list) : Only print the selected slopes
函数的输入参数为
figsize:图像大小
together: 是否将风险回报画在一张图上
window:对风险回报进行移动平均处理,window为移动平均的窗口
select:只显示被选择变量的风险回报
应用举例
from fama_macbeth import Fama_macbeth_regress as fmrmodel = fmr(sample)
model.fit()
model.plot(together=True, window=10)
实际效果