0

我想使用加权最小二乘法估计 GEV(广义极值)分布的参数。我使用 R,并且我发现了一个名为 nls 的函数,我认为它可以用于此目的。它要求一个公式和一个可选的数据集。我想 GEV 公式和年度最大值系列应该在这里,但我不确定如何。有没有人使用过 nls 并且对如何做到这一点有任何想法?

#Vector of ranged annual maxima
x <- c(21,24,29,32,32,34,35,35,35,36,37,37,38,40,40,41,43,47,47,52)
w <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2)
data <- list(x=x,w=w)
nls(y ~ exp(-(1+((x-location)/scale))^(-1/shape)),data=data, weights=w,start=list(location=5,scale=2,shape=0.10))                 

该错误表明 y 丢失。y 是我们优化 GEV 参数时得到的,因此对于所有 x(也取决于权重),y 变得尽可能接近 x。所以 y 在我们估计 GEV 参数之前是未知的……

4

1 回答 1

0

As @Roland commented, you need to have two variables to do a regression. In this case, you only have one: the observed values for the GEV. As such you don't actually want to fit the distribution using nls, but some other algorithm, for example maximum likelihood. See the package evd which has functions to deal with GEVs including fitting them from data.

于 2013-06-18T17:58:43.593 回答