c - calculating double integrals in R quickly -
c - calculating double integrals in R quickly -
i'm looking solution double integral faster
integrate(function(y) { sapply(y, function(y) { integrate(function(x) myfun(x,y), llim, ulim)$value }) }, llim, ulim)
with eg
myfun <- function(x,y) cos(x+y) llim <- -0.5 ulim <- 0.5
i found old paper referred fortran programme called quad2d
, couldn't find else help pages matlab rest. i'm looking c or fortran library can double integrals quick (i.e. without sapply loop), , can called r. ideas much appreciated, long they're gpl compatible.
if solution involves calling other functions libraries shipped r, i'd love hear them well.
the cubature bundle 2d (and n-d) integration using adaptive algorithm. should outperform simpler approaches integrands.
c r fortran integral
Comments
Post a Comment