Multivariate integration with infinite limits

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Multivariate integration with infinite limits

paul smith-6
Dear All,

Can R perform multivariate integration with infinite limits of integration?

Thanks in advance,

Paul

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multivariate integration with infinite limits

Uwe Ligges


Paul Smith wrote:
> Dear All,
>
> Can R perform multivariate integration with infinite limits of integration?

No, R does numerical (not symbolical) calculations, hence it can never
perform integration (not even univariate) with infinite limits.

Uwe Ligges



> Thanks in advance,
>
> Paul
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multivariate integration with infinite limits

paul smith-6
On Nov 10, 2007 12:43 PM, Uwe Ligges <[hidden email]> wrote:
> > Can R perform multivariate integration with infinite limits of integration?
>
> No, R does numerical (not symbolical) calculations, hence it can never
> perform integration (not even univariate) with infinite limits.

Not entirely true in the one-dimensional case:

> f <- function(x) {exp(-x)}
> integrate(f,0,Inf)
1 with absolute error < 5.7e-05
>

Paul

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multivariate integration with infinite limits

Prof Brian Ripley
In reply to this post by Uwe Ligges
On Sat, 10 Nov 2007, Uwe Ligges wrote:

>
>
> Paul Smith wrote:
>> Dear All,
>>
>> Can R perform multivariate integration with infinite limits of integration?
>
> No, R does numerical (not symbolical) calculations, hence it can never
> perform integration (not even univariate) with infinite limits.

Not really true, as I managed to implement it in integrate().  There is
nothing to stop a numerical integration routine working on an infinite
interval if some assumptions are made about the rate of decay of the
integrand at infinity: several of the classical numerical quadrature
formulae (e.g. Gauss-Hermite) are for infinite intervals.  (You can think
of these as making a particular pre-assigned transformation to e.g. [-1,
1].)

dqagi is adaptive, but at the heart is a Gauss-Kronrod rule done on a
half-infinite interval.


--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multivariate integration with infinite limits

slre
In reply to this post by paul smith-6
Ermmm... from ?integrate
"Description:

     Adaptive quadrature of functions of one variable over a finite or
     infinite interval."

R maps infinite intervals to a finite interval before numerical integration, provided that you tell it that the limits are infinite.

Using integrate() over multivariate intervals will get very slow, though; I wouldn't do that...

Steve E
>>> Uwe Ligges <[hidden email]> 11/10/07 12:43 PM >>>


Paul Smith wrote:
> Dear All,
>
> Can R perform multivariate integration with infinite limits of integration?

No, R does numerical (not symbolical) calculations, hence it can never
perform integration (not even univariate) with infinite limits.

Uwe Ligges



> Thanks in advance,
>
> Paul
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multivariate integration with infinite limits

Uwe Ligges
Thanks to all who corrected my misinformation!

Uwe Ligges



S Ellison wrote:

> Ermmm... from ?integrate
> "Description:
>
>      Adaptive quadrature of functions of one variable over a finite or
>      infinite interval."
>
> R maps infinite intervals to a finite interval before numerical integration, provided that you tell it that the limits are infinite.
>
> Using integrate() over multivariate intervals will get very slow, though; I wouldn't do that...
>
> Steve E
>>>> Uwe Ligges <[hidden email]> 11/10/07 12:43 PM >>>
>
>
> Paul Smith wrote:
>> Dear All,
>>
>> Can R perform multivariate integration with infinite limits of integration?
>
> No, R does numerical (not symbolical) calculations, hence it can never
> perform integration (not even univariate) with infinite limits.
>
> Uwe Ligges
>
>
>
>> Thanks in advance,
>>
>> Paul
>>
>> ______________________________________________
>> [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Multivariate integration with infinite limits

Rolf Turner
In reply to this post by Uwe Ligges

On 11/11/2007, at 1:43 AM, Uwe Ligges wrote:

> Paul Smith wrote:
>> Dear All,
>>
>> Can R perform multivariate integration with infinite limits of  
>> integration?
>
> No, R does numerical (not symbolical) calculations, hence it can never
> perform integration (not even univariate) with infinite limits.


        Are you being deliberately ultra-pedantic?

        E.g.:

        > integrate(function(x){exp(-x^2)},-Inf,Inf)
        1.772454 with absolute error < 4.3e-06
        > sqrt(pi)
        [1] 1.772454

        Seems to me that R can integrate univariate functions between infinite
        limits just fine --- when the functions are sufficiently well behaved.


                        cheers,

                                Rolf

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
[hidden email] 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.