我想对我拥有的一些数据点执行对数 Pearson III 拟合。但是,每次我尝试它时,我都会收到错误消息,我真的不知道该怎么办。我也许应该补充一点,我几天前才开始使用 R,所以,我不是这方面的专家。
重要的代码部分,没有导入内容的部分等等是这样的:
pIIIpars<-list(shape=1, location=1, scale=1)
dPIII<-function(x, shape, location, scale) PearsonDS::dpearsonIII(x, shape=1, location=1, scale=1, params=pIIIpars, log=FALSE)
pPIII<-function(q, shape, location, scale) PearsonDS::ppearsonIII(q, shape=1, location=1, scale=1, params=pIIIpars, lower.tail = TRUE, log.p = FALSE)
qPIII<-function(p, shape, location, scale) PearsonDS::qpearsonIII(p, shape=1, location=1, scale=1, params=pIIIpars, lower.tail = TRUE, log.p = FALSE)
fitPIII<-fitdistrplus::fitdist(flowdata3$OEP, distr="PIII", method="mle", start=list("shape"=5000, "location"=5000, "scale"=5000))
summary(fitPIII)
plot(fitPIII)
我正在使用 PearsonDS 包来定义 Log Pearson III 分布,并使用 fitdistrplus 来进行拟合。
我总是得到的错误信息是这样的:
[1] "Error in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data, : \n function cannot be evaluated at initial parameters\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data, ddistnam = ddistname, hessian = TRUE, method = meth, lower = lower, upper = upper, ...): function cannot be evaluated at initial parameters>
Error in fitdistrplus::fitdist(flowdata3$OEP, distr = "PIII", method = "mle", :
the function mle failed to estimate the parameters,
with the error code 100
我确实理解错误消息,它只是;如果这不是传递初始值的正确方法,那是什么?有人有想法吗?
干杯,罗伯特