Integration is based on triangulation of the (transformed) polygonal domain
and formulae from the
Abramowitz and Stegun (1972) 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.
polyCub.exact.Gauss(polyregion, mean = c(0, 0), Sigma = diag(2),
plot = FALSE)mean and covariance matrix of the bivariate normal density to be integrated.
logical indicating if an illustrative plot of the numerical
integration should be produced. Note that the polyregion will be
transformed (shifted and scaled).
The integral of the bivariate normal density over polyregion.
Two attributes are appended to the integral value:
number 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.
Approximate absolute integration error stemming 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).
Abramowitz, M. and Stegun, I. A. (1972). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover Publications.
circleCub.Gauss for quasi-exact cubature of the
isotropic Gaussian density over a circular domain.
Other polyCub-methods: polyCub.SV,
polyCub.iso,
polyCub.midpoint, polyCub
# NOT RUN {
# see example(polyCub)
# }
Run the code above in your browser using DataLab