An average is an integration rule in disguise
Suppose is the continuous-time methane emissions rate of a facility. We want its annual total,
But we observe the path only at 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 . The error between the true mean and the sample mean is
There are two distinct ways for this to be large:
- The path can change violently between measurements.
- 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 ,
The right side is a product:
- belongs to the path.
- belongs to the observation schedule.
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 has rate and normalized duration , measured as a fraction of the year:
Each episode contributes a jump up of 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 , rate , duration , and occupancy ,
This is the unification:
- Rate: larger episode rates create larger jumps.
- Frequency: more episodes create more up-and-down transitions.
- Duration: at fixed occupancy or annual mean, shorter episodes require more frequent or larger excursions.
- Within-episode variability: every additional rise and fall adds variation beyond the rectangular approximation.
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 . 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:
- Year A rises once, remains high for six months, and falls once.
- Year B switches between zero and ten every week.
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 , the jump up contributes and the jump down contributes another . With 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 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 cannot be carried over to clustered, missing, or opportunistic observations merely because their count is also .
Returning to annual units
If 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.
The integral stays at 1.000 while κ = 1.84 controls concentration around each peak.
For this periodic family, V(f) = 2K × [max(f) − min(f)].
For 12 midpoint samples, D* = 1 / (2n).
Realized error can jump or worsen at a particular sample count; the deterministic ceiling falls smoothly as discrepancy falls.
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 directly. The simulator constructs a smooth periodic time series . Every displayed function has the same exact integral:
The displayed family is a normalized exponential cosine:
Here is the number of excursions, moves them relative to the sample points, and controls concentration. At , the numerator and denominator are both constant, so : a perfectly horizontal line. As grows, each broad hill contracts into a taller, narrower peak while normalization preserves the integral.
For this family, each of the cycles rises once from its minimum to its maximum and falls once:
The interactive solves for 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 . The simulator shows:
- the exact integral;
- the sample-average estimate;
- the realized integration error;
- the requested total variation and the derived time series;
- the current schedule discrepancy and Koksma–Hlawka ceiling;
- realized error across the full range of sample counts.
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 . Realized error need not improve monotonically at every displayed sample count, but the worst-case midpoint ceiling contracts smoothly as .
Now restore the application. A methane-emissions rate is simply a physically meaningful time series in place of ; 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 .
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:
- a confidence interval;
- a posterior credible interval;
- a sensor accuracy specification;
- an expected-error formula;
- proof that a particular cadence is universally sufficient.
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:
- quasi-Monte Carlo methods seek low-discrepancy point sets;
- randomized quadrature replaces deterministic worst-case claims with probabilistic ones;
- generalized discrepancy bounds pair other notions of function complexity with other sampling rules;
- classical error bounds use derivatives or smoothness instead of total variation;
- Bayesian quadrature represents uncertainty about the integrand itself.
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
- C. Aistleitner and J. Dick, “Functions of bounded variation, signed measures, and a general Koksma–Hlawka inequality,” Acta Arithmetica 167(2), 2015.
- F. J. Hickernell, “A generalized discrepancy and quadrature error bound,” Mathematics of Computation 67(221), 1998.