Re: [R] big difference in estimate between dmvnorm and dnorm, how come?

From: Ben Bolker <>
Date: Sat 21 Jan 2006 - 02:49:55 EST

saverio vicario <saverio.vicario <at>> writes:

> Dear R community,
> I was trying to estimate density at point zero of a multivariate
> distribution (9 dimensions) and for this I was using a multinormal
> approximation and the function dmvnorm , gtools package.
> To have a sense of the error I tried to look the mismatch between a
> unidimensional version of my distribution and estimate density at
> point zero with function density, dmvnorm and dnorm.
> At my big surprise dmvnorm and dnorm give very different result and
> dmvnorm match even better the theoritical distribution than the
> function density. How come?

  Because dnorm takes the standard deviation and dmvnorm (which is in the mvtnorm package, not the gtools package) takes the variance as an argument. replace var(X) with sd(X) in your call to dnorm and everything will make more sense.

    Ben Bolker mailing list PLEASE do read the posting guide! Received on Sat Jan 21 03:30:35 2006

This archive was generated by hypermail 2.1.8 : Sat 21 Jan 2006 - 06:23:07 EST