library(VGAM)
library(fitdistrplus)
fitdist(u_NI$k_u, 'truncpareto',
start = list(lower=1,
upper=42016,
shape=1)) -> fit.k_u
length(u_NI$k_u) = 637594
我收到了这个错误:
<simpleError in optim(par = vstart, fn = fnobj, fix.arg = fix.arg, obs = data, gr = gradient, ddistnam = ddistname, hessian = TRUE, method = meth, lower = lower, upper = upper, ...): function cannot be evaluated at initial parameters>
Error in fitdist(u_NI$k_u, "truncpareto", start = list(lower = 1, upper = 42016, :
the function mle failed to estimate the parameters,
with the error code 100
In addition: Warning messages:
1: In fitdist(u_NI$k_u, "truncpareto", start = list(lower = 1, upper = 42016, :
The dtruncpareto function should return a zero-length vector when input has length zero
2: In fitdist(u_NI$k_u, "truncpareto", start = list(lower = 1, upper = 42016, :
The ptruncpareto function should return a zero-length vector when input has length zero
问题出在数据集过大还是起始参数上?
可重复的例子:
library(VGAM)
library(fitdistrplus)
rtruncpareto(100,1,100,1.5) -> a
fitdist(a, "truncpareto",
start = list(lower=1,
upper=100,
shape=1.5))
这是行不通的,我不明白为什么。
这里似乎有问题:
argument 'lower' must be positive