r - 使用 fitdistrplus 拟合 Gumbel 分布

标签 r model-fitting fitdistrplus

我正在尝试从 this answer 中复制代码,但是我在这样做时遇到了问题。我正在使用包 VGAM 中的gumbel 发行版和 fitdistrplus .
做的时候出现问题:

fit   = fitdist(data1, 'gumbel', start = list(location = 0, scale = 1))
Error in mledist(data, distname, start, fix.arg, ...) : 
  'start' must specify names which are arguments to 'distr'.

好像locationscale不是*gumbel 的论据。
dgumbel , pgumbel , rgumbelqgumbelVGAM 正确提供.
然而,该包还提供了一个名为 gumbel 的函数。 , 具有不同的语法。这可能会导致问题吗?

编辑:是的,它确实引起了问题:使用包 FAdist而是工作得很好。

最佳答案

供引用,来自 package vignette在评论中链接:

library(fitdistrplus)
data(groundbeef)
serving <- groundbeef$serving
dgumbel <- function(x, a, b) 1/b*exp((a-x)/b)*exp(-exp((a-x)/b))
pgumbel <- function(q, a, b) exp(-exp((a-q)/b))
qgumbel <- function(p, a, b) a-b*log(-log(p))
fitgumbel <- fitdist(serving, "gumbel", 
    start=list(a=10, b=10))

或者使用来自 VGAM 的函数:
rm(dgumbel) ## get rid of previous definition
## hack behaviour of VGAM::pgumbel() a little bit
pgumbel <- function(x,...) {
  if (length(x)==0) numeric(0) else VGAM::pgumbel(x,...)
}
library(VGAM)
fitgumbel <- fitdist(serving, "gumbel", 
       start=list(location=10, scale=10))

关于r - 使用 fitdistrplus 拟合 Gumbel 分布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36087240/

相关文章:

python - 是否可以在 sklearn 中组合多个部分拟合估计量?

python - 使用 scipy 的 RectBivariateSpline 和 SmoothBivariateSpline 对噪声数据进行样条曲面拟合

matlab - matlab中的均匀分布拟合

r - 为什么在使用 plotstyle ="ggplot"时 qqcomp 函数中没有显示任何点?

r - 如何从图形中获取值?

R ggridges 图 - 显示 y 轴刻度和标签

R 图箭头类型和大小

r - 在 'par(mfrow ='无法实现的布局中布置图

r - 在管道中使用bind_rows

r - 使用 ggplot2 绘制 fitdist 图