powered by
Romberg's adaptive integration
romberg(f, a, b, m, tab = FALSE)
function to integrate
the lowerbound of integration
the upperbound of integration
the maximum number of iterations
if TRUE, return the table of values
TRUE
the value of the integral
The romberg function uses Romberg's rule to calculate the integral of the function f over the interval from a to b. The parameter m sets the number of intervals to use when evaluating. Additional options are passed to the function f when evaluating.
romberg
f
a
b
m
Other integration: adaptint, gaussint, giniquintile, mcint, midpt, revolution-solid, simp38, simp, trap
adaptint
gaussint
giniquintile
mcint
midpt
revolution-solid
simp38
simp
trap
Other newton-cotes: adaptint, giniquintile, midpt, simp38, simp, trap
# NOT RUN { f <- function(x) { sin(x)^2 + log(x)} romberg(f, 1, 10, m = 3) romberg(f, 1, 10, m = 5) romberg(f, 1, 10, m = 10) # }
Run the code above in your browser using DataLab