`fitdist`错误消息:函数mle无法估计参数,错误代码为1

时间:2018-06-21 16:35:00

标签: r distribution fitdistrplus

我正在尝试使用fitdist包中的fitdistrplus函数来使数据适合Burr分布。

library(fitdistrplus)     
library(actuar)

fit_bur <- fitdist(data=c(6,8,6,3,3,6,6,6,7,8,4,5,1,4,4,0,0,0,0,7,5,6,6,5,3,4,8,6,5,6,3,6,5,4,3,9,4,2,4), method = "mle",distr="burr", 
               start = list(shape1 = 0.3, shape2 = 1, rate = 1))

然后发生错误: enter image description here

here发布的问题的启发,我注意到错误可能是我的数据包含0个值,因此我将0.1加到所有0个值上。

fit_bur <- fitdist(data=c(6,8,6,3,3,6,6,6,7,8,4,5,1,4,4,0.1,0.1,0.1,0.1,7,5,6,6,5,3,4,8,6,5,6,3,6,5,4,3,9,4,2,4),  method = "mle",distr="burr", 
               start = list(shape1 = 0.3, shape2 = 1, rate = 1))

但是,会发生其他错误: enter image description here

这个问题有解决方案吗?感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

尝试此代码,即使它会给您带来标准错误的机会:

data_you <- c(6,8,6,3,3,6,6,6,7,8,4,5,1,4,4,0.1,0.1,0.1,0.1,7,5,6,6,5,3,4,8,6,5,6,3,6,5,4,3,9,4,2,4)

fit_bur <- fitdist(data_you,"burr", start = list(shape1 = 0.3, shape2 = 1, rate = 1),lower=c(0,0))