jdryr123 2022-08-17 16:04
浏览 80
已结题

使用statsmodels.api 的OLS回归得到的结果是空的

使用statsmodels.api 的OLS回归得到的结果是空的
代码

x=df_合并[['指数超额收益率']]
x = sm.add_constant(x)
reg = sm.OLS(df_合并['超额收益率'],x).fit()
display(reg.summary())

结果

OLS Regression Results都是nan

Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.

求各位帮忙解答!感谢
  • 写回答

1条回答

  • jdryr123 2022-08-17 23:12
    关注

    已解决,dataframe中有一个nan,dropna()后没有问题了

    评论

报告相同问题?

问题事件

  • 系统已结题 8月25日
  • 创建了问题 8月17日