| vc_integral_compare | R Documentation |
Compare numerical quadrature rules
vc_integral_compare(
f,
interval,
methods = c("trapezoid", "simpson", "adaptive"),
n = 32L,
abs_tol = 1e-08,
rel_tol = 1e-08,
subdivisions = 100L,
reference = NULL
)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
interval |
Two finite real bounds, allowing reversed or equal bounds. |
methods |
Nonempty unique vector of quadrature method names. |
n |
Initial number of equal cells for fixed rules; positive integer, even and at least two for Simpson. Ignored by the adaptive rule. |
abs_tol, rel_tol |
Nonnegative finite absolute and relative diagnostic tolerances; at least one must be positive. Adaptive integration also applies the tolerance restrictions of stats::integrate(). |
subdivisions |
Positive integer maximum adaptive subinterval count; ignored by fixed rules. |
reference |
Optional finite analytical/reference integral. |
Plain list with type, interval, results (complete integration objects), table (method, estimate, error_estimate, tolerance_met, status, error, abs_error), reference and note. Actual reference errors are NA when reference is absent. No best method is asserted.
vc_integral_compare(sin,c(0,pi),reference=2)$table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.