The wrapper function polyCub
can be used to call specific cubature
methods via its method
argument. It calls polyCub.SV
by default, which implements general-purpose product Gauss cubature.
polyCub(polyregion, f, method = c("SV", "midpoint", "iso", "exact.Gauss"),
..., plot = FALSE)
The approximated integral of f
over polyregion
.
a polygonal domain.
The following classes are supported:
"owin"
from package spatstat.geom,
"gpc.poly"
from rgeos (or
gpclib),
"SpatialPolygons"
, "Polygons"
,
and "Polygon"
from package sp, as well as
"(MULTI)POLYGON"
from package sf.
(For these classes, polyCub knows how to get an xylist
.)
a two-dimensional real-valued function to be integrated over
polyregion
. As its first argument it must take a coordinate matrix,
i.e., a numeric matrix with two columns, and it must return a numeric vector
of length the number of coordinates.
For the "exact.Gauss"
method
,
f
is ignored since it is specific to the bivariate normal density.
choose one of the implemented cubature methods (partial
argument matching is applied), see help("polyCub-package")
for an overview. Defaults to using product Gauss cubature
implemented in polyCub.SV
.
arguments of f
or of the specific method
.
logical indicating if an illustrative plot of the numerical integration should be produced.
Details and examples in the vignette("polyCub")
and on the method-specific help pages.
Other polyCub-methods:
polyCub.SV()
,
polyCub.exact.Gauss()
,
polyCub.iso()
,
polyCub.midpoint()