Cubature over Polygonal Domains
The R package polyCub implements cubature (numerical integration) over polygonal domains. It solves the problem of integrating a continuously differentiable function f(x,y) over simple closed polygons.
polyCub provides the following cubature methods,
which can either be called explicitly or via the generic
polyCub
function:
polyCub.SV
:General-purpose product Gauss cubature (Sommariva and Vianello, 2007)
polyCub.midpoint
:Simple two-dimensional midpoint rule based on
as.im.function
from spatstat.geom
(Baddeley et al., 2015)
polyCub.iso
:Adaptive cubature for radially symmetric functions
via line integrate()
along the polygon boundary
(Meyer and Held, 2014, Supplement B, Section 2.4).
polyCub.exact.Gauss
:Accurate (but slow) integration of the bivariate Gaussian density
based on polygon triangulation (via tristrip
from
gpclib) and (numerous) evaluations of cumulative densities (via
pmvnorm
from package mvtnorm).
Note that there is also a function circleCub.Gauss
to integrate the isotropic Gaussian density over a
circular domain.
A more detailed description and benchmark experiment of the above cubature
methods can be found in the vignette("polyCub")
and in
Meyer (2010, Section 3.2).
Abramowitz, M. and Stegun, I. A. (1972). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover Publications.
Baddeley, A., Rubak, E. and Turner, R. (2015). Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press, London.
Meyer, S. (2010). Spatio-Temporal Infectious Disease Epidemiology based on Point Processes. Master's Thesis, LMU Munich. Available as https://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: 10.1214/14-AOAS743
Sommariva, A. and Vianello, M. (2007). Product Gauss cubature over polygons based on Green's integration formula. BIT Numerical Mathematics, 47 (2), 441-453. doi: 10.1007/s10543-007-0131-2
vignette("polyCub")
For the special case of a rectangular domain along the axes (e.g., a bounding box), the cubature package is more appropriate.
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.