Learn R Programming

R2Cuba (version 1.1-0)

R2Cuba-package: \Sexpr[results=rd,stage=build]{tools:::Rd_package_title("#1")}R2CubaMultidimensional Numerical Integration

Description

\Sexpr[results=rd,stage=build]{tools:::Rd_package_description("#1")}R2CubaIt is a wrapper around the Cuba-1.6 library by Thomas Hahn available from the URL http://www.feynarts.de/cuba/. Implement four general-purpose multidimensional integration algorithms: Vegas, Suave, Divonne and Cuhre.

Arguments

References

The Cuba library is described at http://www.feynarts.de/cuba/. User documentation is available in T. Hahn (2005) CUBA-a library for multidimensional numerical integration. Computer Physics Communications, 168, 78-95. (http://arxiv.org/pdf/hep-ph/0404043).

See Also

The R-package “cubature”

Examples

Run this code
integrand <- function(arg, weight) {
  x <- arg[1]
  y <- arg[2]
  z <- arg[3]
  ff <- sin(x)*cos(y)*exp(z);
return(ff)
} # end integrand
NDIM <-3
NCOMP <- 1
vegas(NDIM, NCOMP, integrand, rel.tol=1e-3,  abs.tol=1e-12)

Run the code above in your browser using DataLab