[R] adaptIntegral takes too much time

Alaios alaios at yahoo.com
Thu Jan 27 18:20:20 CET 2011


Hello Dear List members,

as you can see (and guess) from the code below

adaptIntegrate(f,lowerLimit=c(-1,-1),upperLimit=c(.9999,.9999))
$integral
[1] 9.997e-09

$error
[1] 1.665168e-16

$functionEvaluations
[1] 17

$returnCode
[1] 0

> adaptIntegrate(f,lowerLimit=c(-1,-1),upperLimit=c(1,1))


the last command runs for 45 mins now.

-this one takes only less than sec: 
adaptIntegrate(f,lowerLimit=c(-1,-1),upperLimit=c(.9999,.9999))
-but this runs to infinity:
(I ll leave computer open all night just in case it terminates)
adaptIntegrate(f,lowerLimit=c(-1,-1),upperLimit=c(1,1))

I do not really want to bother you with the details of my code so do you might have any idea what might cause this?

f is
f <- as.function(psipol*phipol) #  Multivariate polynomial to function

and

f(c(1,1))
returns immediately results.

Any clue what should I try to check?

I would like to thank you for your advice

Best Regards
Alex



More information about the R-help mailing list