Re: [R] integrate dmvtnorm

2010-06-24 Thread Christos Argyropoulos
r will ask 'f' for a vector of function evaluations at the set of nodes). This can be achieved either explicitly or implicitly (by calling the sapply inside the function). Christos  Date: Wed, 23 Jun 2010 20:22:15 -0400 Subject: Re: [R] integrate dmvtnorm From: carrieands...@gmail.c

Re: [R] integrate dmvtnorm

2010-06-23 Thread Ravi Varadhan
une 23, 2010 8:23 pm Subject: Re: [R] integrate dmvtnorm To: Christos Argyropoulos Cc: r-help@r-project.org > Thanks! > Both suggestions are very helpful. > One more question: > Can I use Vectorize to solve double integration question ? > > Now that > f=function(x, y)

Re: [R] integrate dmvtnorm

2010-06-23 Thread Christos Argyropoulos
From: carrieands...@gmail.com > To: R-help@r-project.org > Subject: [R] integrate dmvtnorm > > Hello, everyone, > > I have a question about integration of product of two densities. > Here is the sample code; however the mean of first density is a function of > another r

Re: [R] integrate dmvtnorm

2010-06-23 Thread Carrie Li
00e-14 1.887638e-17 > > > suggesting the solution: > > vf<-Vectorize(f) > > > integrate(vf,lower=-Inf, upper=Inf) > > 0.1314427 with absolute error < 4e-05 > > > Christos > > > > > > Date: Wed, 23 Jun 2010 19:05:53 -0400 > > From: car

Re: [R] integrate dmvtnorm

2010-06-23 Thread Ravi Varadhan
r < 4e-05 > Hope this helps, Ravi. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Carrie Li Sent: Wednesday, June 23, 2010 7:06 PM To: r-help Subject: [R] integrate dmvtnorm Hello, everyone, I have a question about integratio

[R] integrate dmvtnorm

2010-06-23 Thread Carrie Li
Hello, everyone, I have a question about integration of product of two densities. Here is the sample code; however the mean of first density is a function of another random variable, which is to be integrated. ## f=function(x) {dmvnorm(c(0.6, 0.8), mean=c(0.75, 0.75/x))*dnorm(x, mean=0.6, sd=0.15