polyCub-package: Cubature over Polygonal Domains

Description Details References See Also


The R package polyCub provides methods for cubature (numerical integration) over polygonal domains. The function polyCub() is the main entry point of the package. It is a wrapper around the specific cubature methods listed below.



Two-dimensional midpoint rule. Polygons are converted to binary pixel images using the as.im.function method from package spatstat (Baddeley and Turner, 2005). The integral is then obtained as the sum over (pixel area * f(pixel midpoint)).


Product Gauss cubature as proposed by Sommariva and Vianello (2007).


Efficient adaptive cubature for isotropic functions via line integrate() along the polygon boundary, see Meyer and Held (2014, Supplement B, Section 2.4).


Quasi-exact method specific to the integration of the bivariate Gaussian density over polygonal domains. It is based on formulae from Chapter 26 of the Abramowitz and Stegun (1972) handbook, i.e. triangulation of the polygonal domain (using tristrip of package gpclib) and appropriate evaluations of pmvnorm from package mvtnorm. Note that there is also a function circleCub.Gauss to perform integration of the isotropic Gaussian density over circular domains.

See Section 3.2 of Meyer (2010) for a more detailed description and benchmark experiment of some of the above cubature methods (and others).


Abramowitz, M. and Stegun, I. A. (1972). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover Publications.

Baddeley, A. and Turner, R. (2005). spatstat: an R package for analyzing spatial point patterns. Journal of Statistical Software, 12 (6), 1-42.

Meyer, S. (2010). Spatio-Temporal Infectious Disease Epidemiology based on Point Processes. Master's Thesis, LMU Munich. Available as http://epub.ub.uni-muenchen.de/11703/.

Meyer, S. and Held, L. (2014). Power-law models for infectious disease spread. The Annals of Applied Statistics, 8 (3), 1612-1639.
DOI-Link: http://dx.doi.org/10.1214/14-AOAS743, arXiv:1308.5115

Sommariva, A. and Vianello, M. (2007). Product Gauss cubature over polygons based on Green's integration formula. Bit Numerical Mathematics, 47 (2), 441-453.

See Also

The packages cubature and R2Cuba, which are more appropriate for cubature over simple hypercubes.

polyCub documentation built on May 26, 2017, 5:02 p.m.

Search within the polyCub package
Search all R packages, documentation and source code