【发布时间】:2021-04-19 12:27:51
【问题描述】:
我正在尝试使用scipy.stats 在 Python 中复制 R 的 fitdist() 结果(参考,无法修改 R 代码)。结果完全不同。有谁知道为什么?如何在 Python 中复制 R 的结果?
data = [2457.145, 1399.034, 20000.0, 476743.9, 24059.6, 28862.8]
R 代码:
library(fitdistrplus)
library(actuar)
fitdist(data, 'pareto', "mle")$estimate
R 结果:
shape scale
0.760164 10066.274196
Python 代码
st.pareto.fit(data, floc=0, scale=1)
Python 结果
(0.4019785013487883, 0, 1399.0339889072732)
【问题讨论】:
-
您能否说明您使用哪些 R 库来实现帕累托分布和
fitdist? -
我使用
actuar和fitdistrplus库 -
@WarrenWeckesser PDF 似乎有点不同...但是是否有可能在 Python 中获得相同的 PDF?
标签: python r scipy data-science