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.

Reply via email to