Re: [R] Double integration using R

2011-11-06 Thread R. Michael Weylandt
There do exist packages for multi-variate integration in R, but sticking to base functions, what you've described should work but the inner integral will need to be vectorized before it's passes to the outer integral: Vectorize() can do this directly, but it won't be particularly fast since it's

[R] Double integration using R

2011-11-06 Thread Robert A'gata
Hi, I have a function that I need to do double integration: \int^T_0 \int^t_0 N(\delta / \sigma \sqrt(u)) (1-N(\delta / \sigma \sqrt(u))) du dt where N(x) is a standard normal probability of x. I start off by writing an inner integral into a function. Meaning \int^t_0 N(\delta,\sigma \sqrt(u))

Re: [R] Double Integration

2010-07-04 Thread Ravi Varadhan
dicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: Bogaso Christofer Date: Saturday, July 3, 2010 9:12 am Subject: RE: [R] Double Integration To: 'Ravi Varadhan' , r-help@r-project.org > H

Re: [R] Double Integration

2010-07-03 Thread Hans W Borchers
Bogaso Christofer gmail.com> writes: > > Hi Ravi, your suggestion helped me as well a lot. If I look into > that function, I see this function is calling another function : > > .Call("doCubature", as.integer(fDim), body(f.check), > as.double(lowerLimit), as.double(upperLimit), >

Re: [R] Double Integration

2010-07-03 Thread Prof Brian Ripley
ed, rather archived: see http://cran.r-project.org/src/contrib/Archive/adapt/ Christos CC: argch...@hotmail.com; sarah_sanche...@yahoo.com; r-help@r-project.org From: dwinsem...@comcast.net To: rvarad...@jhmi.edu Subject: Re: [R] Double Integration Date: Fri, 2 Jul 2010 20:40:00 -0400 A

Re: [R] Double Integration

2010-07-03 Thread Bogaso Christofer
hristos Argyropoulos'; sarah_sanche...@yahoo.com; r-help@r-project.org Subject: Re: [R] Double Integration There is no package called `integrate', but there is a function called `adaptIntegrate' in the "cubature" package. Ravi. -Original Message- From: r-help-boun...@r

Re: [R] Double Integration

2010-07-03 Thread Christos Argyropoulos
.@comcast.net > To: rvarad...@jhmi.edu > Subject: Re: [R] Double Integration > Date: Fri, 2 Jul 2010 20:40:00 -0400 > > And an adapt() in fCopulae. > > -- > David. > On Jul 2, 2010, at 7:06 PM, Ravi Varadhan wrote: > > > There is no package called `integrat

Re: [R] Double Integration

2010-07-02 Thread David Winsemius
[mailto:r-help-boun...@r-project.org ] On Behalf Of Christos Argyropoulos Sent: Friday, July 02, 2010 8:41 AM To: sarah_sanche...@yahoo.com; r-help@r-project.org Subject: Re: [R] Double Integration Function adapt in package integrate maybe? Date: Thu, 1 Jul 2010 05:30:25 -0700 From: sarah_sa

Re: [R] Double Integration

2010-07-02 Thread Ravi Varadhan
02, 2010 8:41 AM To: sarah_sanche...@yahoo.com; r-help@r-project.org Subject: Re: [R] Double Integration Function adapt in package integrate maybe? > Date: Thu, 1 Jul 2010 05:30:25 -0700 > From: sarah_sanche...@yahoo.com > To: r-help@r-project.org > Subject: [R] Double Integrati

Re: [R] Double Integration

2010-07-02 Thread Christos Argyropoulos
Function adapt in package integrate maybe? > Date: Thu, 1 Jul 2010 05:30:25 -0700 > From: sarah_sanche...@yahoo.com > To: r-help@r-project.org > Subject: [R] Double Integration > > Dear R helpers > > I am working on the Bi-variate Normal distribution probabilit

Re: [R] Double Integration

2010-07-01 Thread Ravi Varadhan
Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: Hans W Borchers Date: Thursday, July 1, 2010 2:47 pm Subject: Re: [R] Double Integration To: r-h...@stat.math.ethz.ch > Sarah Sanchez yahoo.com> writes: > > > > Dear R helper

Re: [R] Double Integration

2010-07-01 Thread Hans W Borchers
Sarah Sanchez yahoo.com> writes: > > Dear R helpers > > I am working on the Bi-variate Normal distribution probabilities. > I need to double integrate the following function > (actually simplified form of bivariate normal distribution) > > f(x, y) = exp [ - 0.549451 * (x^2 + y^2 - 0.6 * x * y)

Re: [R] Double Integration

2010-07-01 Thread David Winsemius
On Jul 1, 2010, at 8:30 AM, Sarah Sanchez wrote: Dear R helpers I am working on the Bi-variate Normal distribution probabilities. I need to double integrate the following function (actually simplified form of bivariate normal distribution) f(x, y) = exp [ - 0.549451 * (x^2 + y^2 - 0.6 *

[R] Double Integration

2010-07-01 Thread Sarah Sanchez
Dear R helpers I am working on the Bi-variate Normal distribution probabilities. I need to double integrate the following function (actually simplified form of bivariate normal distribution) f(x, y) = exp [ - 0.549451 * (x^2 + y^2 - 0.6 * x * y) ] where 2.696 < x < 3.54 and -1.51 < y < 1.98 I

Re: [R] Double integration - Gauss Quadrature

2008-09-29 Thread Earl F. Glynn
"Susanne Pfeifer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I would like to solve a double integral of the form > > \int_0^1 \int_0^1 x*y dx dy > > using Gauss Quadrature. OK, I felt guilty for using a for loop, so here's something that should be close to what you wan

Re: [R] Double integration - Gauss Quadrature

2008-09-29 Thread Earl F. Glynn
"Susanne Pfeifer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I would like to solve a double integral of the form . . . > but I would like to use Gauss Quadrature to do it. > I have written the following code (using R's statmod package) which > works fine for one integral

[R] Double integration - Gauss Quadrature

2008-09-27 Thread Susanne Pfeifer
Hi, I would like to solve a double integral of the form \int_0^1 \int_0^1 x*y dx dy using Gauss Quadrature. I know that I can use R's integrate function to calculate it: integrate(function(y) { sapply(y, function(y) { integrate(function(x) x*y, 0, 1)$value }) }, 0, 1) but I would like to use

[R] Double integration - Gauss Quadrature

2008-09-27 Thread Susanne Pfeifer
Hi, I would like to solve a double integral of the form \int_0^1 \int_0^1 x*y dx dy using Gauss Quadrature. I know that I can use R's integrate function to calculate it: integrate(function(y) { sapply(y, function(y) { integrate(function(x) x*y, 0, 1)$value }) }, 0, 1) but I would like to use