我正在使用distrplus包中的Fitdistcens函数拟合指数分布。我的数据集包含完整的数据和暂停数据。但是,“ exp”会在下面给我一条错误消息:
<simpleError in optim(par = vstart, fn = fnobjcens, fix.arg = fix.arg,
gr = gradient,
rcens = rcens, lcens = lcens, icens = icens, ncens = ncens,
ddistnam = ddistname, pdistnam = pdistname, hessian = TRUE,
method = meth, lower = lower, upper = upper, ...): non-finite finite-
difference value [1]>
Error in fitdistcens(dataset1, "exp") :
the function mle failed to estimate the parameters,
with the error code 100
这是我的代码:
dataset1<-dataset[1:2]
library(fitdistrplus)
fitexp <- fitdistcens(dataset1,"exp")
有人可以帮助我解决此错误代码吗?我可以共享我的数据集。