Compute an approximation of the integral of the function f(x) with respect to dx in the range [a, b] by Monte-Carlo integration using uniform sampling.
# S3 method for MCI plot(x, ...)
x_range | A |
---|---|
fun | A |
B | A |
seed | A |
A list
containing the following attributes:
Estimated value of the integral
Estimated variance of the estimator
#> $I #> [1] 0.3322249 #> #> $var #> [1] 8.882763e-07 #> #> $fun #> [1] "x^2" #> #> $x_range #> [1] 0 1 #> #> $B #> [1] 1e+05 #> #> attr(,"class") #> [1] "MCI"#> $I #> [1] 0.06281515 #> #> $var #> [1] 7.002655e-08 #> #> $fun #> [1] "x^2*sin(x^2/pi)" #> #> $x_range #> [1] 0 1 #> #> $B #> [1] 1e+05 #> #> attr(,"class") #> [1] "MCI"