簡體   English   中英

如何使用“MME”方法擬合威布爾分布並在 R 中找到估計值

[英]How to fit Weibull distribution using “MME” method and find the estimates in R

我正在嘗試使用 MME 方法在 R 中擬合威布爾分布並找到估計值。 下面是用於擬合來自 fitdistrplus 和 actuar 包的 R 中的 weibull 分布的代碼。

a <- rweibull(100, 10,1)
weibul_mme <- mmedist(a, "weibull", order = 1:2)

但我收到以下錯誤

Error in mmedist(a, "weibull", order = 1:2) : 
  the empirical moment function must be defined

如果有人能告訴我我犯了什么錯誤或提供一些相同的閱讀材料,那將會很有幫助

下面的 R 代碼,Microsoft R Open 3.5.3 x64,Win 10

library(fitdistrplus)
library(actuar)

x <- rweibull(1000, 10,1)

memp <- function(x, order) mean(x^order)

weibul_mme <- mmedist(x, "weibull", order = 1:2, memp=memp)
fit.weibull<- fitdist(x, "weibull", method = "mme", order=c(1, 2), memp=memp, lower = c(0, 0))

print(weibul_mme)
print(fit.weibull)

plot(fit.weibull, demp=TRUE)

使用 MME 方法產生合理的擬合

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM