Learn R Programming

polyCub (version 0.4-2)

polyCub.exact.Gauss: Quasi-Exact Cubature of the Bivariate Normal Density

Description

Integration is based on triangulation of the polygonal domain and formulae from Chapter 26 of the Abramowitz & Stegun handbook (Section 26.9, Example 9, pp. 956f.). This method is quite cumbersome because the A&S formula is only for triangles where one vertex is the origin (0,0). For each triangle of the tristrip we have to check in which of the 6 outer regions of the triangle the origin (0,0) lies and adapt the signs in the formula appropriately. (AOB+BOC-AOC) or (AOB-AOC-BOC) or (AOB+AOC-BOC) or (AOC+BOC-AOB) or .... However, the most time consuming step is the evaluation of pmvnorm.

Usage

polyCub.exact.Gauss(polyregion, mean = c(0, 0), Sigma = diag(2),
  plot = FALSE)

Arguments

polyregion
a "gpc.poly" polygon or something that can be coerced to this class, e.g., an "owin" polygon (converted via owin2gpc
mean,Sigma
mean and covariance matrix of the bivariate normal density to be integrated.
plot
logical indicating if an illustrative plot of the numerical integration should be produced. Note that the polyregion will be shifted and scaled.

Value

  • The integral of the bivariate normal density over polyregion. Two attributes are appended to the integral value:
  • nEvalnumber of triangles over which the standard bivariate normal density had to be integrated, i.e. number of calls to pmvnorm and pnorm, the former of which being the most time-consuming operation.
  • errorApproximate absolute integration error steming from the error introduced by the nEval pmvnorm evaluations. For this reason, the cubature method is in fact only quasi-exact (as is the pmvnorm function).

References

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

See Also

circleCub.Gauss for quasi-exact cubature of the isotropic Gaussian density over a circular domain.

Other polyCub.methods: .polyCub.iso, polyCub.iso; polyCub.SV; polyCub.midpoint; polyCub

Examples

Run this code
# see example(polyCub)

Run the code above in your browser using DataLab