Skip to content
Back to formatted view

Raw Message

Message-ID: <1BDAE2969943D540934EE8B4EF68F95FB22F4CBBE8@EXNSW-MBX03.nexus.csiro.au>
Date: 2009-03-02T12:34:45Z
From: Bill Venables
Subject: density > 1?
In-Reply-To: <49ABD0C6.9090808@hygiene.uni-wuerzburg.de>

Because densities are not probabilities.  It is the area under the density curve that represents probability.

Example: the chi-squared density with 1 degree of freedom has a singularity at the zero and is unbounded.  The area under the curve, however, is still 1.

(This is a distressingly common misconception.  It is really not an R issue but a distribution theory issue.)

Bill Venables
________________________________________
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Johannes Elias [jelias at hygiene.uni-wuerzburg.de]
Sent: 02 March 2009 22:27
To: r-help at r-project.org
Subject: [R] density > 1?

Dear R-Gurus,

I wonder why 'density' values as shown in hist or plot(density(x)) are
sometimes over 1. How can that be?

Example

>hist(rnorm(1000,sd=.5),freq=FALSE)

The resulting plot shows density values below 1 on the y-axis. However,

>hist(rnorm(1000,sd=.1),freq=FALSE)

shows density values over 1.

How to interpret density values over 1?

Greetings,

Johannes

______________________________________________
R-help at r-project.org 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.