mcTorusIntegrate {sdetorus} | R Documentation |
Monte Carlo integration on the torus
Description
Convenience function for Monte Carlo integration on
[-\pi, \pi)^p
.
Usage
mcTorusIntegrate(f, p, M = 1e+05, fVect = TRUE, ...)
Arguments
f |
function to be integrated. |
p |
dimension of the torus. |
M |
number of Monte Carlo replicates. |
fVect |
is |
... |
further parameters passed to |
Value
A scalar with the approximated integral.
Examples
# Integral of sin(x1) * cos(x2), must be close to 0
mcTorusIntegrate(f = function(x) sin(x[, 1]) * cos(x[, 2]), p = 2)
[Package sdetorus version 0.1.10 Index]