Monte Carlo integration with a normal distribution {Rfast2} | R Documentation |
Monte Carlo Integration with a normal distribution
Description
Monte Carlo Integration with a normal distribution.
Usage
mci(fun, R = 10^6)
Arguments
fun |
A function denoting the inside part of the expectation to be computed. |
R |
The number of draws from the normal distribution. |
Value
The result of the integral.
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
References
Morgan B. J. (2018). Elements of simulation. Chapman & Hall/CRC.
See Also
Examples
## compute the expectation of abs(x)
fun <- function(x) abs(x)
mci(fun, R = 10^5)
a <- function(x) abs(x) * dnorm(x)
integrate(a, -Inf, Inf)
[Package Rfast2 version 0.1.5.2 Index]