AW: [R] numericDeriv and ecdf

Thomas Lumley tlumley at u.washington.edu
Fri Apr 25 16:22:38 CEST 2003


On Fri, 25 Apr 2003, Khamenia, Valery wrote:

> > On only ten points, what did you expect ?  Even with 1000
> > observations, estimating a density is difficult, and has
> > been the subject of a century of research.  Kernel density
> > estimates are among the most successful.  For your immediate
> > application, try  plot(density(rnorm(10)), type="l"), etc.
>
> wait, you misunderstood me!
>
> I'd like to see 10 or 9 points with estimated values of
> *numerical* derivatives according to ecdf output.

The output of ecdf() is a step function, so mathematically its derivative
is zero except where it is undefined.

Everywhere except the jumps numericDeriv() gives the right answer
Exactly at the jumps the derivative is undefined, so it isn't surprising
that numericDeriv gives the wrong answer.

What result did you want?

	-thomas



More information about the R-help mailing list