2
我試圖用fitdist()函數(包含在fitdistrplus包中)將數值向量擬合到幾個分佈:weibull 2-p,weibull 3-P,gamma,對數正態分佈,指數,gumbel,正態,loglogistic,邏輯和廣義lambda。適合具有「fitdist」函數的廣義lambda分佈
其中一些包含在'fitdist()'相同的包中,其他包含在不同的包中,我創建了gumbel分發。我對他們中的任何人都沒有問題,只有GLD。我已經嘗試了fitdist函數(mle,mme ...)以及包「gld」和「GLDEX」的所有方法來創建分發函數。
fitdist(example$`TTF MIN`, "gl", start=list(12139.06, 0.000434674, 0.2, -1.5), method="mle", control=list(trace=1, REPORT=1))
Error in fitdist(example$`TTF MIN`, "gl", start = list(12139.06, 0.000434674, :
the function mle failed to estimate the parameters,
with the error code 100
而且......
memp <- function(x, order) mean(x^order)
fgl <- fitdist(example$`TTF MIN`, "gl", method="mme",order=c(1, 2, 3, 4), memp="memp", start=c(10, 10), lower=1, upper=Inf)
Error in mmedist(data, distname, start = start, fix.arg = fix.arg, ...) :
wrong dimension for the moment order to match
數據基本統計:
min(example$`TTF MIN`)
[1] 1338.149
max(example$`TTF MIN`)
[1] 27485.42
median(example$`TTF MIN`)
[1] 12555.87
mean(example$`TTF MIN`)
[1] 13983.5
sd(example$`TTF MIN`)
[1] 4220.227
skewness(example$`TTF MIN`)
[1] 0.7572039
kurtosis(example$`TTF MIN`)
[1] -0.1358661
quantile(example$`TTF MIN`, probs = c(0.25, 0.5, 0.75, 1))
25% 50% 75% 100%
11006.06 12555.87 17037.58 27485.42
我已經試過您的解決方案不同的數據,似乎它應該工作,但不與我的數據,會出現同樣的錯誤。也許「mle」方法不能具體地處理我的數據? 非常感謝。 –
您是否嘗試過使用'fit.fkml'和'ML'方法? –
是的,它工作正常,不知道爲什麼它不適合fitdist。 –