我正在尝试从这个答案复制代码,但是我在这样做时遇到了问题。我正在使用来自package VGAM和fitdistrplus的gumbel发行版。当这样做时,问题就出现了:
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'.好像location和scale不是*gumbel的论点。
dgumbel、pgumbel、rgumbel和qgumbel是由VGAM正确提供的。但是,包还提供了一个名为gumbel的函数,语法不同。这会否造成问题呢?
编辑:是的,它确实造成了问题:使用包FAdist代替了非常好的工作方式。
发布于 2018-11-25 22:42:42
供参考,请参阅注释中链接的包小体:
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))发布于 2016-12-26 19:30:07
start=list(mu=R,s=R) R=your params
发布于 2017-08-06 20:03:32
这是因为fitdistr软件包不支持gumbel分发。
https://stackoverflow.com/questions/36087240
复制相似问题