[R] cubature

JMDS jessica.dunn at rmit.edu.au
Sun Mar 25 03:15:19 CEST 2012


Hi,

I am using adaptIntegrate from Cubature to do numerical integration on a
double integral with a 1 x 2 vector x.

Say the function is something simple to start like f(x)=x1*x2 and I wish to
integrate x1 over (0,365-x2) and x2 over (0,365)

f <- function(x) {(x[2])*(x[1])} # "x" is vector
int1<-adaptIntegrate(f, lowerLimit = c(0, 0), upperLimit = c(365-x[2], 365))


I recieve the following error:

Error in adaptIntegrate(f, lowerLimit = c(0, 0), upperLimit = c(365 -  : 
  object 'x' not found

The problem is that this code works fine on other machines and I wonder If I
am missing some referenced package somewhere.

Any help would be greatly appreciated.

Thanks!




--
View this message in context: http://r.789695.n4.nabble.com/cubature-tp4502516p4502516.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list