未传递拟合参数时获取Seaborn distplot中拟合曲线的参数

getting the parameters of the fit curve in Seaborn distplot when the fit parameter is not passed

我正在使用 Seaborn distplot

Seaborn.distplot(a = my_data)

。请注意,我没有指定拟合参数或任何其他参数。结果,我得到了 my_data 的直方图(Seaborn 自动分配了 bin 的数量)和适合直方图的曲线。

现在,我的问题是如何得到拟合曲线的参数? distplot 只是 returns 我假设的斧头在拟合曲线上有点而不是参数。

您看到的曲线是数据的核密度估计 (KDE)。您无法从 seaborn 中获取任何参数,但无论如何,高斯 KDE 的参数并不多。唯一免费的参数是带宽,seaborn 也默认设置为 "scott".

import statsmodels.nonparametric.api as smnp
kde = smnp.KDEUnivariate(data)
x,y = kde.fit("gau", "scott", "gau", gridsize=100, cut=3, clip=None)