MyNixOS website logo
Description

Cubature over Polygonal Domains.

Numerical integration of continuously differentiable functions f(x,y) over simple closed polygonal domains. The following cubature methods are implemented: product Gauss cubature (Sommariva and Vianello, 2007, <doi:10.1007/s10543-007-0131-2>), the simple two-dimensional midpoint rule (wrapping 'spatstat.geom' functions), and adaptive cubature for radially symmetric functions via line integrate() along the polygon boundary (Meyer and Held, 2014, <doi:10.1214/14-AOAS743>, Supplement B). For simple integration along the axes, the 'cubature' package is more appropriate.

polyCub

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.

For the special case of a rectangular domain along the axes, the cubature package is more appropriate (cf. CRAN Task View: Numerical Mathematics).

Installation

You can install polyCub from CRAN via:

install.packages("polyCub")

To install the development version from the GitHub repository, use:

## install.packages("remotes")
remotes::install_github("bastistician/polyCub")

Usage

The basic usage is:

library("polyCub")
polyCub(polyregion, f)
  • polyregion represents the integration domain as an object of class "owin" (from spatstat.geom), "gpc.poly" (from gpclib), "SpatialPolygons" (from sp), or "(MULTI)POLYGON" (from sf), or even as a plain list of lists of vertex coordinates ("xylist").

  • f is the integrand and needs to take a two-column coordinate matrix as its first argument.

The polyCub() function wraps the implemented cubature methods and by default calls polyCub.SV(), a C-implementation of product Gauss cubature. Directly calling the desired cubature function is preferable, see the list below.

Implemented cubature methods

  1. polyCub.SV(): General-purpose product Gauss cubature (Sommariva and Vianello, 2007, BIT Numerical Mathematics, https://doi.org/10.1007/s10543-007-0131-2)

  2. polyCub.midpoint(): Simple two-dimensional midpoint rule based on spatstat.geom::as.im.function()

  3. polyCub.iso(): Adaptive cubature for radially symmetric functions via line integrate() along the polygon boundary (Meyer and Held, 2014, The Annals of Applied Statistics, https://doi.org/10.1214/14-AOAS743, Supplement B, Section 2.4)

For details and illustrations see the vignette("polyCub") in the installed package or on CRAN.

Applications

The polyCub package evolved from the need to integrate so-called spatial interaction functions (Gaussian or power-law kernels) over the observation region of a spatio-temporal point process. Such epidemic models are implemented in surveillance.

Feedback

Contributions are welcome! Please submit suggestions or report bugs at https://github.com/bastistician/polyCub/issues or via e-mail to maintainer("polyCub").

License

The polyCub package is free and open source software, licensed under the GPLv2.

Metadata

Version

0.9.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows