我从回归模型的残差中创建了一个直方图和一个QQPlot:
平均值: 0.35标准差: 18.14


从这些情节来看,可以说我的残差是正态分布的吗?或者我还能从这些情节中得到什么呢?
创建直方图
ns.distplot(x, hist=True)结果如下:

发布于 2020-12-24 16:31:59
您可以执行统计测试以确认您的数据是正常分布的,尝试:
from scipy import stats
np.random.seed(42)
x = np.random.normal(2, 1, size=1000)
k2, p = stats.normaltest(x)
alpha = 0.001
print("p = {:g}".format(p))
if p < alpha: # null hypothesis: x comes from a normal distribution
print("The null hypothesis can be rejected")
else:
print("The null hypothesis cannot be rejected")这个函数检验一个样本来自正态分布的空假设。它的基础是D‘’Agostino和Pearson的测试,它将斜度和峰度结合在一起,产生了一个关于常态的综合测试。
https://datascience.stackexchange.com/questions/87103
复制相似问题