Re: [R] density() with from, to or cut and comparrison of density()

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Wed 30 Aug 2006 - 21:01:52 EST

Rainer M Krug wrote:
> Hi
>
> the function density() does normally integrate to one - I've checked it
> and it works and I also read the previous threads.
> But I realised that it does not integrate to one if I use from, to or cut.
>
> My scenario: I simulated densities of a plants originating from an sseed
> source at distance zero. Therefore the density of the plants will be
> highest close to zero. Is there anything I can do to have this pattern?
> If I use 'from' or 'cut', the resulting densities do not integrate to
> one which I need as I want to compare different density curves.

The kernel chosen might be not the ideal one for such a restriction. If the density outside the "cut" range is extremely small, you might want to do a dirty transformation so that the values sum up to 1 again.

> Ny second question is concerning the bandwidth. An I correct in saying
> that if I want to compare different density estimates that the bandwidth
> should be the same for all of them?

Yes.

Uwe Ligges

> Thanks in advance for your help,
>
> Rainer
>



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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 30 22:08:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 31 Aug 2006 - 00:23:19 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.