Re: [R] using kernel density estimates to infer mode of distribution

From: Frank Samuelson <expiregmane1104.m.cudgle_at_neverbox.com>
Date: Sat 18 Feb 2006 - 02:45:44 EST

A density() fit calls the eval x and estimate y: fit<-density(data)
plot(fit$x,fit$y)

Adelchi Azzalini wrote:
> On Wed, 15 Feb 2006 18:28:25 -0500, Dan Rabosky wrote:
>
> DR>
> DR> Is it possible to use "density" or another kernel density
> DR> estimator to identify the mode of a distribution? When I use
> DR> 'density', the resulting
>
> a simple option is of the form
> fit$eval[fit$estimate==max(fit$estimate)]
> assuming that fit$eval is the vector of evaluation points,
> and fit$estimate the corrisponding density estimates (this is
> the sort of output produced by sm.density)
>
> Here I have assumed there is single mode and we are in the scalar
> case, for simplicity. Some variant required in the more general case.
>
>
> best regards,
>
> Adelchi Azzalini



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Feb 18 02:49:07 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:34 EST