mcTorusIntegrate | R Documentation |
Convenience function for Monte Carlo integration on
[-\pi, \pi)^p
.
mcTorusIntegrate(f, p, M = 1e+05, fVect = TRUE, ...)
f |
function to be integrated. |
p |
dimension of the torus. |
M |
number of Monte Carlo replicates. |
fVect |
is |
... |
further parameters passed to |
A scalar with the approximated integral.
# Integral of sin(x1) * cos(x2), must be close to 0
mcTorusIntegrate(f = function(x) sin(x[, 1]) * cos(x[, 2]), p = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.