实证资产定价(Empirical asset pricing)已经发布于Github和Pypi. 包的具体用法(Documentation)博主将会陆续在CSDN中详细介绍,也可以通过Pypi直接查看。
Pypi: pip install --upgrade EAP
Github: GitHub - whyecofiliter/EAP: empirical asset pricing
在实证资产定价中需要对样本进行全方位的描述性统计和相关性分析,此次更新添加了该功能。投资组合的描述性统计主要分为分组统计和变量统计。分组统计是描述每个分组的信息,变量统计是描述每个变量的信息。相关性分析包括每个时间段的变量间的Fisher相关系数和Spearman相关系数,以及整个时间区间的平均相关系数。
描述性统计的具体实现是通过在Univariate中添加summary_statistics函数实现的。函数的说明文档如下。
def summary_statistics(self, variables=None, periodic=False):
This function is for summary statistics and outputs the group statistics and variables statistics.
input :
variables (ndarray/DataFrame): variables, except sort variable, that need to be analyzed.
periodic (boolean): whether print periodic results.
相关性的具体实现是通过在Univariate中添加correlation函数实现的。函数的说明文档如下。
def correlation(se