| vc_accumulation | R Documentation |
Evaluate a signed accumulation function
vc_accumulation(
f,
x,
lower = 0,
method = c("adaptive", "trapezoid", "simpson"),
n = 32L,
abs_tol = 1e-08,
rel_tol = 1e-08,
subdivisions = 100L
)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
x |
Nonempty finite real vector of upper limits. Input order and duplicates are retained; limits below lower reverse orientation. |
lower |
Finite real scalar fixed lower integration limit. |
method |
Quadrature rule: trapezoid, Simpson, or adaptive QUADPACK through stats::integrate(). Improper infinite bounds are not supported. |
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. |
Evaluates A(x) = integral from lower to x of f(t) dt independently at each upper limit; it does not accumulate rounding error along a grid. Equal limits use the integral engine's zero-interval convention. Each integral retains its diagnostics; a returned finite estimate need not satisfy the numerical tolerance. These are signed integrals, not geometric areas. Finite quadrature cannot prove integrability. Split known singularities/discontinuities as appropriate; infinite bounds are absent.
Plain list with type, lower, method, table (x, estimate, error_estimate, tolerance_met, status), results (full vc_integrate objects, one per x) and note.
(function(x)x^2) |> vc_accumulation(x=c(-1,0,1,2),lower=0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.