Skip to content
Prev 174935 / 398503 Next

Confusion about ecdf

On 25-Mar-09 21:01:49, Mandro Litt wrote:
Possibly you first need to be clear about why you need the ECDF,
and at what values of t you need it.

The ECDF is defined for series of values of t. These might be
simply the values in your data, in which case it would be ecdf(u)
where u is the vector of data. It is intended as an estimate,
from the data, of the CDF of the distribution that the data
came from. It basically counts the number of data less than or
equal to a given value, and divides by the total number of data.

Using ecdf() on the values of your estimated density function
would not make a lot of sense.

However, you can base an estimate of the CDF on your kernel
estimate of the density by evaluating at a chosen (finely
distributed) set of u-values, say u1 = 0.01*(-500,500),
and then

  ECDF <- cumsum(f(u1))/sum(f(u1))

where f(u) is an implementation, as an R function, of your
expression above.

Hoping this helps,
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 25-Mar-09                                       Time: 21:20:26
------------------------------ XFMail ------------------------------