adaptint {cmna} | R Documentation |
Adaptive integration
adaptint(f, a, b, n = 10, tol = 1e-06)
f |
function to integrate |
a |
the a-bound of integration |
b |
the b-bound of integration |
n |
the maximum recursive depth |
tol |
the maximum error tolerance |
The adaptint
function uses Romberg's rule to calculate the
integral of the function f
over the interval from a
to b
. The parameter n
sets the number of intervals
to use when evaluating. Additional options are passed to the
function f
when evaluating.
the value of the integral
Other integration:
gaussint()
,
giniquintile()
,
mcint()
,
midpt()
,
revolution-solid
,
romberg()
,
simp38()
,
simp()
,
trap()
Other newton-cotes:
giniquintile()
,
midpt()
,
romberg()
,
simp38()
,
simp()
,
trap()
f <- function(x) { sin(x)^2 + log(x) }
adaptint(f, 1, 10, n = 4)
adaptint(f, 1, 10, n = 5)
adaptint(f, 1, 10, n = 10)