簡體   English   中英

在 R 中使用“extRemes”擬合廣義極值 (GEV) 時出錯?

[英]Error with fitting a Generalized Extreme Value (GEV) using `extRemes` in R?

我有一些數據,我想在 R 中使用extRemes包擬合廣義極值 (GEV) 分布。 但是,出現錯誤:

library(extRemes)
Mydata = c(6,3,3,3,5,5,4,3,5,5,4,3,4,4,6,5,5,4,5,2,6,4,6,5,3,3,8,3,4,4,6,6,6,6,6,5,6,6,5,5)
fit_gev <- fevd(x=Mydata, method = "MLE", type="GEV", period.basis = "year")
summary(fit_gev)

Error in diag(cov.theta) : invalid 'nrow' value (too large or NA)
In addition: Warning message:
In diag(cov.theta) : NAs introduced by coercion

我想知道我該如何解決這個錯誤? 謝謝你的幫助。

您可以使用 EnvStats 包進行調整,如下所示:

library(EnvStats)
# Data
Mydata =
c(6,3,3,3,5,5,4,3,5,5,4,3,4,4,6,5,5,4,5,2,6,4,6,5,3,3,8,3,4,4,6,6,6,6,6,5,6,6,5,5)    
# Generalized Extreme Value (EnvStats)
egevd(Mydata, method = "pwme")# (Method: probability-weighted moments)

Results of Distribution Parameter Estimation
--------------------------------------------

Assumed Distribution:            Generalized Extreme Value

Estimated Parameter(s):          location = 4.268896
                                 scale    = 1.314489
                                 shape    = 0.353434

Estimation Method:               Unbiased pwme

Data:                            Mydata

Sample Size:                     40

暫無
暫無

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

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