[R] returns from dnorm and dmvnorm

2007-02-26 Thread A Hailu
Hi All,
Why would calls to dnorm and dmvnorm return values that are above 1? For
example,
 dnorm(0.3,mean=0, sd=0.1)
[1] 3.989423

This is happening on two different installations of R that I have.

Thank you.

Hailu

[[alternative HTML version deleted]]

__
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.


Re: [R] returns from dnorm and dmvnorm

2007-02-26 Thread Benilton Carvalho
well, nobody said that the density must be smaller than 1, right? :-)

it's just the value of the normal density function at the point you  
asked. you may try doing that by hand and, with the correct math,  
you'll get the same thing.

b

On Feb 26, 2007, at 3:03 PM, A Hailu wrote:

 Hi All,
 Why would calls to dnorm and dmvnorm return values that are above  
 1? For
 example,
 dnorm(0.3,mean=0, sd=0.1)
 [1] 3.989423

 This is happening on two different installations of R that I have.

 Thank you.

 Hailu

__
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.


Re: [R] returns from dnorm and dmvnorm

2007-02-26 Thread Charilaos Skiadas
On Feb 26, 2007, at 3:03 PM, A Hailu wrote:
 Hi All,
 Why would calls to dnorm and dmvnorm return values that are above  
 1? For
 example,
 dnorm(0.3,mean=0, sd=0.1)
 [1] 3.989423

Because dnorm gives you the density function, whose integral is the  
distribution function, which is likely what you want. Try:

pnorm(0.3,mean=0, sd=0.1)

 This is happening on two different installations of R that I have.

 Thank you.

 Hailu

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

__
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.


Re: [R] returns from dnorm and dmvnorm

2007-02-26 Thread Ravi Varadhan
I guarantee that it would also happen on all future versions of R.

Why would you expect density to be smaller than 1?  The only constraints on
density are that (a) it is non-negative and (b) it integrates to one. The
smaller the variance, the greater the density is around its center.  Density
can be made to become arbitrarily large by letting the variance gets close
to zero, and in the limit you will obtain Dirac's delta function.  


Ravi. 


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of A Hailu
Sent: Monday, February 26, 2007 3:04 PM
To: r-help@stat.math.ethz.ch
Subject: [R] returns from dnorm and dmvnorm

Hi All,
Why would calls to dnorm and dmvnorm return values that are above 1? For
example,
 dnorm(0.3,mean=0, sd=0.1)
[1] 3.989423

This is happening on two different installations of R that I have.

Thank you.

Hailu

[[alternative HTML version deleted]]

__
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.

__
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.


Re: [R] returns from dnorm and dmvnorm

2007-02-26 Thread A Hailu
Yes, you are right. Thanks.

On 2/27/07, Benilton Carvalho [EMAIL PROTECTED] wrote:

 well, nobody said that the density must be smaller than 1, right? :-)

 it's just the value of the normal density function at the point you
 asked. you may try doing that by hand and, with the correct math,
 you'll get the same thing.

 b

 On Feb 26, 2007, at 3:03 PM, A Hailu wrote:

  Hi All,
  Why would calls to dnorm and dmvnorm return values that are above
  1? For
  example,
  dnorm(0.3,mean=0, sd=0.1)
  [1] 3.989423
 
  This is happening on two different installations of R that I have.
 
  Thank you.
 
  Hailu


[[alternative HTML version deleted]]

__
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.


Re: [R] returns from dnorm and dmvnorm

2007-02-26 Thread A Hailu
Thanks everyone. I should have thought of dnorm as a straing return from the
normal density formula.

Hailu

On 2/27/07, Charilaos Skiadas [EMAIL PROTECTED] wrote:

 On Feb 26, 2007, at 3:03 PM, A Hailu wrote:
  Hi All,
  Why would calls to dnorm and dmvnorm return values that are above
  1? For
  example,
  dnorm(0.3,mean=0, sd=0.1)
  [1] 3.989423

 Because dnorm gives you the density function, whose integral is the
 distribution function, which is likely what you want. Try:

 pnorm(0.3,mean=0, sd=0.1)

  This is happening on two different installations of R that I have.
 
  Thank you.
 
  Hailu

 Haris Skiadas
 Department of Mathematics and Computer Science
 Hanover College






[[alternative HTML version deleted]]

__
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.