int: int

Description Usage Arguments Value Examples

View source: R/MC_integration.R

Description

The function int() performs a Monte Carlo integration of the function f.

Usage

1
int(f, a, b, n = 10^5)

Arguments

f

the integrand

a

lower bound of integration

b

upper bound of integration

n

number of simulation, per default 10^5

Value

returns a list containing the value of the integral, the 0.95-confidence interval, number of simulations and the function f

Examples

1
2
3
f <- function(x){x^2}
MCint <- int(f, -2, 2)
MCint$'Value of integral'

aumath-advancedr2019/ACM_2019 documentation built on Nov. 26, 2019, 2:07 a.m.