View source: R/integrate2_normal.R
integrate2_normal | R Documentation |
Expected value of a function of two independent standard Gaussian variables
integrate2_normal(f, ...)
f |
Function to integrate over. Input to
|
... |
Additional arguments to hcubature |
A numeric value
\int \int f(x, y) \varphi(x) \varphi(y) dx dy,
where \varphi(\cdot)
is the standard Gaussian density.
## Not run:
# Second moment of a Gaussian
# tol = 0.0001, true value = 2, evaluated = 2.000001
f <- function(x) x[1]^2 + x[2]^2
integrate2_normal(f, tol = 1e-4)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.