On Jan 8, 2013, at 9:43 AM, Naser Jamil wrote:
Hi R-users.
I'm having difficulty with an integration in R via
the package "cubature". I'm putting it with a simple example here.
I wish
to integrate a function like:
f(x1,x2)=2/3*(x1+x2) in the interval 0<x1<x2<7. To be sure I tried it
by hand and got 114.33, but the following R code is giving me
102.6667.
-------------------------------------------------------------------
library(cubature)
f<-function(x) { 2/3 * (x[1] + x[2] ) }
adaptIntegrate(f, lowerLimit = c(0, 0), upperLimit = c(x[2],7))
What is x[2]? On my machine it was 0.0761, so I obviously got a
different answer.
--
David Winsemius, MD
Alameda, CA, USA
______________________________________________
R-help@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.