Dear All, Can R perform multivariate integration with infinite limits of integration? Thanks in advance, Paul
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 > > ______________________________________________ > 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.
On Nov 10, 2007 12:43 PM, Uwe Ligges <ligges at statistik.uni-dortmund.de> 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
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, ripley at stats.ox.ac.uk 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
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 <ligges at statistik.uni-dortmund.de> 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 > > ______________________________________________ > 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.______________________________________________ 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.
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}}