#计算因子暴露的标准方式是最小二乘回归, 可以使用pandas.ols
pd.ols(y=port, x=factors).beta
C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2881: FutureWarning: The pandas.stats.ols module is deprecated and will be removed in a future version. We refer to external packages like statsmodels, see some examples here: http://www.statsmodels.org/stable/regression.html
exec(code_obj, self.user_global_ns, self.user_ns)

本文介绍了一种使用最小二乘回归计算因子暴露的方法,并提供了具体的Python代码示例。该方法通过pandas库实现,但需要注意的是,pandas中的ols模块已被弃用,建议使用如statsmodels等外部包。

1559

被折叠的 条评论
为什么被折叠?



