简体   繁体   中英

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. The WNLS method consist of 2 steps

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.

Can anyone let me know how to calculate EDF function $F_n$ for a data "X" in R? Does ecdf(X)(X) will calculate the ECDF? If so then, what is the need for ecdf(X) other than plotting? Also it would be really helpful if someone share some example code which involves the calculation of ECDF for data.

The ecdf call creates a function. That is, you can apply ecdf(X) to other data, as your ecdf(X)(X) call does. However, you might want to apply ecdf(X) to something other than X itself. 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_)) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM