vc_riemann: Compute signed tagged Riemann sums

View source: R/riemann.R

vc_riemannR Documentation

Compute signed tagged Riemann sums

Description

Compute signed tagged Riemann sums

Usage

vc_riemann(
  f,
  interval = NULL,
  n = 10L,
  method = c("midpoint", "left", "right"),
  partition = NULL
)

Arguments

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.

Details

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.

Value

Plain list with type, interval, partition, method, estimate, table (cell limits, width, midpoint, sample, value, contribution), and note.

Examples

function_to_sum <- function(x)x^2
function_to_sum |> vc_riemann(interval=c(0,2),n=100)

vectorialcalculus documentation built on Nov. 17, 2026, 1:09 a.m.