Re: [R] integration of two normal density

2010-06-28 Thread Matt Shotwell
; 1/4 on [0,2] . > > -- Bert > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Carrie Li > Sent: Saturday, 26 June 2010 1:28 PM > To: r-help > Subject: [R] integration of two normal density > >

Re: [R] integration of two normal density

2010-06-28 Thread Bert Gunter
: Re: [R] integration of two normal density Your intuition is wrong and R is right. Why should the product of two probability density functions be a normalized pdf also? -- as is trivially seen with two uniforms on [0,2], with pdf= 1/2, product = 1/4 on [0,2] . -- Bert -Original Message

Re: [R] integration of two normal density

2010-06-26 Thread Matt Shotwell
On Fri, 2010-06-25 at 23:28 -0400, Carrie Li wrote: > 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, m

Re: [R] integration of two normal density

2010-06-26 Thread Ravi Varadhan
hool of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: Carrie Li Date: Friday, June 25, 2010 11:29 pm Subject: [R] integration of two normal density To: r-help > Hello everyone, > > I have a question about integration

Re: [R] integration of two normal density

2010-06-25 Thread Bill.Venables
-help Subject: [R] integration of two normal density 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, me

[R] integration of two normal density

2010-06-25 Thread Carrie Li
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