Re: [R] integration of two normal density

From: Ravi Varadhan <rvaradhan_at_jhmi.edu>
Date: Sat, 26 Jun 2010 09:27:40 -0400

I sent you a "doubble integration" solution a couple of days ago, that answered your question. You did not have the coureteousy to acknowledge that. Now, you are asking a different question that is "incorrectly" formulated. What you are doing is not "multivariate" integration. You are just integrating a univariate function, which as Prof. Venables pointed out, is not even a density.

Ravi.


Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology School of Medicine
Johns Hopkins University

Ph. (410) 502-2619
email: rvaradhan_at_jhmi.edu

> Hello everyone,
>
> I have a question about integration of two density function
> Intuitively, I think the value after integration should be 1, but
> they are
> not. Am I missing something here ?
>
> > t=function(y){dnorm(y, mean=3)*dnorm(y/2, mean=1.5)}
> > integrate(t, -Inf, Inf)
> 0.3568248 with absolute error < 4.9e-06
>
>
> Also, is there any R function or package could do multivariate
> integration ?
>
> Thanks for any suggestions!
>
> Carrie
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
>
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.



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. Received on Sat 26 Jun 2010 - 13:31:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 26 Jun 2010 - 14:10:35 GMT.

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

list of date sections of archive