[英]Computing ECDF of a data for parameter estimation using weighted nonlinear least square in R
I am writing a code for estimating the parameter of a GPD using weighted nonlinear least square(WNLS) method.我正在编写使用加权非线性最小二乘 (WNLS) 方法估计 GPD 参数的代码。 The WNLS method consist of 2 steps
WNLS 方法包括 2 个步骤
step 1: $(\\hat{\\xi_1} , \\hat{b_1}) = arg\\ \\min_{(\\xi,b)} \\sum_{i=1}^{n} [\\log(1-F_n(x_i)) - log(1-G_{\\xi,b}(x_i))]$ , here $F_n$ is the ECDF and $1-G_{\\xi,b}$ is the generalized pareto distribution.步骤 1: $(\\hat{\\xi_1} , \\hat{b_1}) = arg\\ \\min_{(\\xi,b)} \\sum_{i=1}^{n} [\\log(1-F_n( x_i)) - log(1-G_{\\xi,b}(x_i))]$ ,这里$F_n$是 ECDF, $1-G_{\\xi,b}$是广义帕累托分布。
Can anyone let me know how to calculate EDF function $F_n$ for a data "X" in R?谁能告诉我如何为 R 中的数据“X”计算 EDF 函数$F_n$ ? Does
ecdf(X)(X)
will calculate the ECDF? ecdf(X)(X)
会计算 ECDF 吗? If so then, what is the need for ecdf(X)
other than plotting?如果是这样,那么除了绘图之外还需要什么
ecdf(X)
? Also it would be really helpful if someone share some example code which involves the calculation of ECDF for data.如果有人分享一些涉及计算数据的 ECDF 的示例代码,这也将非常有帮助。
The ecdf
call creates a function. ecdf
调用创建一个函数。 That is, you can apply ecdf(X)
to other data, as your ecdf(X)(X)
call does.也就是说,您可以将
ecdf(X)
应用于其他数据,就像您的ecdf(X)(X)
调用一样。 However, you might want to apply ecdf(X)
to something other than X
itself.但是,您可能希望将
ecdf(X)
应用于X
本身以外的其他内容。 If you want to know the empirical quantile to which three numbers a
, b
, and c_
correspond, an easy way to do that is to call ecdf(X)(c(a, b, c_))
.如果您想知道三个数字
a
、 b
和c_
对应的经验分位数,一个简单的方法是调用ecdf(X)(c(a, b, c_))
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.