| vc_riemann | R Documentation |
Compute signed tagged Riemann sums
vc_riemann(
f,
interval = NULL,
n = 10L,
method = c("midpoint", "left", "right"),
partition = NULL
)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
interval |
Finite increasing bounds, or NULL with partition supplied. |
n |
Positive regular partition size; ignored with partition supplied. |
method |
One of midpoint, left or right. These are sample rules, not lower/upper Darboux sums. |
partition |
Optional vc_partition result. Its cells are reconstructed from breaks to validate consistency; interval, if given, must match. |
Computes sum f(sample_i)*width_i. Negative heights contribute negatively: this is not geometric area. All sampled values/contributions and the total must be finite. A lower Darboux sum uses the infimum on every cell; upper uses its supremum. Endpoint heights (or minima/maxima of finitely many samples) do not establish these extrema for general f. Riemann convergence requires appropriate integrability and vanishing mesh; a finite table or an increasing cell count is not a proof of convergence.
Plain list with type, interval, partition, method, estimate, table (cell limits, width, midpoint, sample, value, contribution), and note.
function_to_sum <- function(x)x^2
function_to_sum |> vc_riemann(interval=c(0,2),n=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.