An average is an integration rule in disguise

Suppose Q(t)Q(t) is the continuous-time methane emissions rate of a facility. We want its annual total,

But we observe the path only at nn times. A familiar shortcut averages those measurements and multiplies by the length of the year:

That looks like arithmetic. Mathematically, it is quadrature: we are replacing an integral with a weighted sum. The observation times are the quadrature nodes, whether or not the measurement program calls them that.

Once stated this way, the real question becomes sharper:

What properties of the path and the sample locations control the integration error?

Two ways an average can fail

Normalize the year to u[0,1]u\in[0,1]. The error between the true mean and the sample mean is

There are two distinct ways for this to be large:

  1. The path can change violently between measurements.
  2. The measurements can cover the year unevenly.

Koksma–Hlawka turns that intuition into an inequality.

The one-line theorem

For a function of bounded variation and observation points u1,,unu_1,\ldots,u_n,

The right side is a product:

This separation is the theorem’s great conceptual gift. But for intermittent methane, the first factor is more than a generic smoothness penalty. It compresses the central physical features of the emissions history into one quantity that directly controls worst-case annualization error.

Total variation is the emissions-difficulty budget

Total variation is the largest cumulative absolute change found over every possible partition:

It is tempting to call this merely “spikiness.” The stronger interpretation is that total variation is the path-complexity budget Koksma–Hlawka needs. It increases when emissions jump by larger amounts, jump more often, or fluctuate within an episode.

Consider a simple facility-year with non-overlapping rectangular episodes. Episode jj has rate RjR_j and normalized duration j\ell_j, measured as a fraction of the year:

Each episode contributes a jump up of RjR_j and a jump down of the same size. When episode boundaries do not coincide,

Its exact annual methane and annual-average rate are

Now define the rate-weighted mean episode duration

Combining the expressions gives the relationship that matters:

At a fixed annual mean, shorter rate-weighted duration necessarily means greater total variation. The path must deliver the same mass through briefer support, which requires larger jumps, more jumps, or both. That is the duration term hiding inside the one-number complexity measure.

For equal-rate, equal-duration episodes with frequency ν\nu, rate RR, duration \ell, and occupancy ρ=ν\rho=\nu\ell,

This is the unification:

Those are precisely the ingredients that make intermittent methane difficult to integrate from a finite set of snapshots. Koksma–Hlawka does not average them away. It asks for an upper bound on their combined worst-case effect.

Total variation does not identify frequency, duration, and rate separately. Many emissions histories can share the same V(Q)V(Q). That is not a defect here. For the integration problem, those histories belong to the same worst-case complexity class. The separate parameters matter for explaining and mitigating emissions; their combined variation matters for guaranteeing the annual integral.

Same average, radically different difficulty

Imagine two years that spend exactly half their time at zero and half at ten:

The two years have the same histogram, mean, variance, minimum, and maximum. They do not have the same total variation. Every additional switch adds another absolute jump.

For an isolated rectangular pulse of height RR, the jump up contributes RR and the jump down contributes another RR. With kk such pulses,

The active fraction, rate distribution, and exact annual integral can remain fixed while total variation grows linearly with episode frequency. Average behavior says the two paths are equivalent. The worst-case integration geometry says they are not.

Discrepancy is about coverage, not count

In one dimension, star discrepancy asks how far the empirical fraction of observations before each point aa departs from the fraction of the year that has elapsed:

Ten surveys spread across the year and ten surveys concentrated in one month have the same sample count. They do not have the same discrepancy.

For equally spaced midpoint observations,

This is the clean connection to sampling frequency—but it depends on the schedule. The formula 1/(2n)1/(2n) cannot be carried over to clustered, missing, or opportunistic observations merely because their count is also nn.

Returning to annual units

If QQ is measured in kilograms of methane per hour and the normalized interval represents an 8,760-hour year, then

Substituting the episode-path identity makes duration explicit:

The inequality now reads like the methane problem itself. For the same annual-average emissions, the guarantee deteriorates as the characteristic duration shrinks. For the same emissions path, the guarantee improves as the observation schedule becomes more evenly distributed.

For midpoint sampling, this becomes

The expression is useful because it exposes what must be defended. A claim about annual integration accuracy requires not just a sample count, but a credible upper bound on the combined rate–frequency–duration complexity of the path and an honest description of sample placement.

The interactive below temporarily leaves methane—and physical units—behind. It isolates the theorem on the normalized interval so the relationship among a function, its total variation, the sample points, and the resulting integration error is visible without an application-specific wrapper.

LIVE MODEL / TOTAL VARIATION × SAMPLE COUNT

From flat line to spiky function.

At V(f) = 0 the function is exactly flat. Raise variation and the same unit integral concentrates into progressively sharper excursions.

COMPUTING LOCALLY

The model solves for the smoothness parameter that makes V(f) equal the selected value while keeping ∫f(u)du = 1.

Exact integral1.000
Sample estimate0.491
Realized error−0.509
K–H ceiling± 1.500
Time series f(u) and selected sample pointsV(f) = 36.0 · ∫f(u)du = 1
13.2001f(u)NORMALIZED TIME u
What changes as the sample count grows?Equally spaced midpoint samples
REALIZED ABSOLUTE INTEGRATION ERRORCONDITIONAL K–H CEILING2.2409.70246122452104365SAMPLE COUNT n
CONSTRUCTED FUNCTION6 smooth excursions · max 3.08 · min 0.08

The integral stays at 1.000 while κ = 1.84 controls concentration around each peak.

FUNCTION COMPLEXITYV(f) = 36.0

For this periodic family, V(f) = 2K × [max(f) − min(f)].

SAMPLING GEOMETRYD* = 0.0417

For 12 midpoint samples, D* = 1 / (2n).

BOUND SATISFIED

Realized error can jump or worsen at a particular sample count; the deterministic ceiling falls smoothly as discrepancy falls.

Total variation is the function-side difficulty. The fixed vertical axis makes the transition honest: V(f) = 0 is a horizontal line at one; high variation concentrates the same area into narrow peaks. Increase n and inspect the error curve: this particular function can alias with the sample points, while the worst-case ceiling contracts as 1/n.

Nonnegative, smooth periodic functions on [0,1] with integral 1 and equally spaced midpoint samples. Koksma–Hlawka requires bounded variation. The displayed ceiling is deterministic and worst-case, not a confidence interval or expected error.

How to read the interactive

Choose the total variation V(f)V(f) directly. The simulator constructs a smooth periodic time series f(u)f(u). Every displayed function has the same exact integral:

The displayed family is a normalized exponential cosine:

Here KK is the number of excursions, ϕ\phi moves them relative to the sample points, and κ\kappa controls concentration. At κ=0\kappa=0, the numerator and denominator are both constant, so f(u)=1f(u)=1: a perfectly horizontal line. As κ\kappa grows, each broad hill contracts into a taller, narrower peak while normalization preserves the integral.

For this family, each of the KK cycles rises once from its minimum to its maximum and falls once:

The interactive solves for κ\kappa so this expression equals the total variation selected by the reader. The vertical axis remains fixed while the slider moves. That detail is essential: the chart must not zoom in on the nearly flat function and make it look as extreme as the high-variation case.

Sample count is a separate control. Samples are placed at equally spaced midpoints, so the displayed discrepancy is exactly 1/(2n)1/(2n). The simulator shows:

Start at zero variation and watch the horizontal line at one. Raise total variation slowly: broad undulations appear, then sharpen into peaks without changing the exact integral. Move those peaks within their cycles: the integral and variation stay unchanged while realized sample error can jump because the sample points alternately hit and miss them. Finally, increase nn. Realized error need not improve monotonically at every displayed sample count, but the worst-case midpoint ceiling contracts smoothly as 1/n1/n.

Now restore the application. A methane-emissions rate is simply a physically meaningful time series in place of f(u)f(u); its annual mass is the integral instead of the normalized value one. Short, high-rate episodes play the role of the narrow excursions, and field measurements play the role of the sample points. The geometry is the same.

Why the upper bound matters

An average-case analysis asks what error we expect under a chosen stochastic model for emissions. Koksma–Hlawka asks a different and, for measurement design, unusually powerful question:

What error can this schedule guarantee against every emissions path inside a stated total-variation budget?

That guarantee does not depend on the path being typical. Rare, short, high-rate episodes are not discounted because they happen infrequently in a fitted population. If they fit inside the permitted variation class, the bound must protect against them.

This is why the theorem complements rather than duplicates probabilistic annualization. It turns assumptions about plausible rate changes, event counts, durations, and within-event volatility into a design requirement through V(Q)DnV(Q)D_n^*.

The distinction still needs precise language. Koksma–Hlawka is deterministic: it does not say the realized error is likely to be near the bound, and it does not attach a probability to the interval. It is therefore not:

Randomized sampling can support probabilistic error analysis, but that is a different argument requiring a sampling design and probability model. Measurement noise and bias also sit outside the classical inequality. They must be added separately.

The strongest limit is what happens without regularity

Suppose we refuse to bound variation, amplitude, smoothness, bandwidth, or any other property of the path. Between any finite collection of observations, we can insert an arbitrarily tall, arbitrarily narrow excursion that misses every sample.

The observations remain unchanged. The integral can become arbitrarily large.

That is not a weakness of Koksma–Hlawka. It is the underlying impossibility the theorem makes visible:

Finite samples provide no finite worst-case integration guarantee over an unrestricted class of paths.

Every defensible annualization method therefore contains a regularity assumption somewhere. It may appear as bounded variation, a Gaussian-process kernel, a frequency cutoff, a persistence model, a spline penalty, a physical mass-balance model, or a prior over episodes. The assumption can be reasonable. It cannot be absent.

Where the trail leads next

Koksma–Hlawka opens several related mathematical paths:

Each framework answers a slightly different question. The durable habit is to identify the function class, the sampling rule, and the kind of guarantee before interpreting the resulting number.

Method note. This article uses the one-dimensional bounded-variation form of Koksma–Hlawka. The episode identities assume deterministic, non-overlapping rectangular episodes with distinct boundaries. Overlapping episodes and continuous within-episode fluctuations can change the path’s total variation, although the general inequality still applies when that full variation is finite. A defensible variation envelope must come from continuous monitoring, engineering constraints, or another explicit regularity assumption; sparse snapshots alone do not identify it. Detection error, quantification noise, and measurement bias are outside the displayed bound and must be modeled separately.

References