CivilEase / Traffic engineering
Same speeds.
Different sampling.
Different averages.
Time mean speed, space mean speed and the variance relation explained with proper maths and a free calculator.
Time mean speed is the arithmetic average of vehicle speeds recorded as they pass a fixed point. For vehicles covering the same road length, space mean speed is that length divided by the mean travel time, giving the harmonic mean of the individual segment speeds.
Those formulas are easy to remember. The important part is identifying how the vehicles were sampled, and whether a variance formula is exact or approximate. This guide works through both.
Two distinctions to keep: “Harmonic mean” is appropriate for the equal-distance or corresponding point-speed calculation below. A spatial snapshot already samples vehicles over space, so its arithmetic average has a different meaning. Also, use ≈, not =, for the small-dispersion time-variance approximation.
Time mean speed and space mean speed: definitions
Time mean speed, TMS
A detector line or radar records successive vehicles over an observation interval. Give each observed vehicle one count.
Space mean speed, SMS
Track the same N vehicles over the same section length L. Divide the total vehicle-distance by total vehicle-time.
Keep units consistent: kilometres and hours give km/h; metres and seconds give m/s. Travel times should include any stopped time if your aim is the average travel speed, rather than a running speed that excludes stops.
Time mean and space mean speed calculator
Use a list of positive point-speed observations. Every number represents one observed vehicle. The harmonic result estimates the corresponding SMS when the point speeds represent the vehicles’ speeds over the section. It is not a converter for arbitrary drone snapshots.
Your calculated speed means
- Vehicle observations
- Arithmetic minus harmonic
- Point-sample variance σt²
- Reweighted spatial variance σs²
- Small-dispersion SMS approximation
- Approximation error vs harmonic result
- Exact reweighted variance check
Variances use population-style normalization, not N − 1. The spatial variance here comes from inverse-speed weights for this same point sample; it is not the ordinary variance of the point observations.
A large speed spread can make the approximation inaccurate, even negative. Use the harmonic result for these positive inputs. This result alone does not verify the section-speed assumption.
Why does space mean speed become a harmonic mean?
Take N vehicles, each travelling the same distance L. Let vi be vehicle i’s average speed over that section. Its travel time is:
Average the travel times first, then divide the common distance by that average:
The common distance cancels. What remains is the harmonic mean. A slower vehicle contributes a larger travel time, which lowers the distance-per-time average.
If your inputs are spot speeds: this derivation uses an additional assumption that those spot speeds adequately represent section-average speeds. It can fail when vehicles accelerate, brake or stop within the section. A short section alone does not guarantee that assumption. [2]
Solved example: vehicles at 30 and 60 km/h
Suppose one vehicle travels at 30 km/h and another at 60 km/h over a 1 km section, with constant speeds for this illustration.
Their section travel times are 2 minutes and 1 minute. Together they complete 2 vehicle-kilometres in 3 vehicle-minutes:
Intuition: we did not give the slower vehicle an arbitrary bonus weight. Its extra time in the distance-over-time calculation creates the weighting.
Why time mean speed is at least space mean speed
For the same positive-speed list, the arithmetic mean is at least the harmonic mean. A direct proof follows from the Cauchy–Schwarz inequality:
Divide by the positive quantity N times the sum of reciprocal speeds:
Equality holds when all observed speeds are equal. With unequal positive speeds, the arithmetic mean is greater. This comparison does not imply that every independently collected point sample must exceed every independently collected spatial snapshot: those may describe different vehicles, places or traffic states.
The exact variance relation: use spatial variance
Let kj be the density of a speed class travelling at vj, and let qj be its flow. In the corresponding stationary, spatially consistent traffic-stream representation:
Write spatial proportions as pj = kj/k. Density-weighted SMS and its spatial variance are:
Time sampling weights classes by flow. Substituting qj = kjvj gives:
Therefore, for vs > 0:
The variance is about vs, using spatial/density weights. Replacing it with the ordinary variance of point-observed speeds changes the equation. The spatial weighting in the IIT Bombay derivation is the key to this identity. [3]
Check the exact relation for 30 and 60 km/h
For equal point-sample frequencies, spatial weights are proportional to 1/v: the weights become 2/3 at 30 km/h and 1/3 at 60 km/h.
The ordinary point-sample variance is 225 (km/h)², which is a different number.
Deriving the approximation from point-speed variance
Now follow the Taylor-expansion approach. Define deviations from the point-sample arithmetic mean:
Here εi is a deviation from the mean, not necessarily a measurement error. We use N in the denominator because this is an algebraic moment of the supplied observations, not an unbiased variance estimate using N − 1.
Show the Taylor expansion step by step
Expand the reciprocal around vt. If the individual deviations are small relative to the mean, retain terms through ε²:
Average the reciprocal speeds. The first-order deviation term sums to zero:
Invert that truncated expression:
Then use 1/(1+x) ≈ 1−x for small x. This gives the small-dispersion approximation below. Higher-order deviation terms have been omitted, so neither step makes the expression exact for an arbitrary speed distribution.
Use this as an approximation. It works best when individual speeds are close to the mean. Large spreads and speeds near zero can make it misleading. If the original positive speeds are available, compute their harmonic mean directly.
Exact relation
Spatially weighted variance about vs; corresponding traffic-stream model.
Small-dispersion approximation
Point-sample variance about vt; truncated expansion.
Second example: 50, 60 and 70 km/h
Consider three equally counted point observations, used as representative section speeds for this calculation.
The approximation is about 0.0104 km/h higher, a relative error of about 0.0176% for this example. It is close, but not exactly equal.
For 30 and 60 km/h, it gives 45 − 225/45 = 40 km/h. In fact, for any two equally counted positive speeds, this expression matches their harmonic mean as an algebraic special case. That does not make it exact for a general list of three or more observations.
What if the speeds come from a paused drone video?
If you identify all vehicles in a road section at one instant and estimate each vehicle’s speed from nearby frames, you have a spatial snapshot. Its arithmetic mean estimates the mean speed of vehicles occupying that section at that instant. Do not call it TMS solely because an arithmetic average was used. [2]
Taking the harmonic mean of the same snapshot is not the usual correction from time sampling to space sampling: the vehicles have already been sampled over space. Slower vehicles may already appear more often because they spend longer in the section.
Specify whether your data are point passages, a section snapshot, complete section travel times or trajectories within a space–time region. For general trajectory data, the aggregate distance divided by aggregate time within the chosen region is the relevant calculation; do not blindly apply the equal-distance shortcut.
Common questions and mistakes
Is “space mean speed = harmonic mean” always correct?
It is the equal-distance speed aggregation for the same vehicles, and can estimate SMS from a corresponding representative point sample. It does not mean every dataset labelled “speed” should be harmonically averaged. A spatial snapshot is a different sampling design.
What if vehicles travel unequal distances?
Use total distance divided by total time. For a trip covering 1 km at 30 km/h and 3 km at 60 km/h, the overall speed is 4/(1/30 + 3/60) = 48 km/h. The unweighted harmonic mean of 30 and 60 is 40 km/h and is not the correct unequal-distance trip average.
Which speed belongs in q = kv?
Use a space-mean speed consistent with the flow, density, location and observation conditions. If q is veh/h and k is veh/km on the same lane basis, v is km/h. Substituting a point arithmetic mean can change the inferred density.
Can I enter zero speed?
The reciprocal-speed formula needs positive values, so this calculator rejects zero. Do not delete stopped vehicles from a spatial snapshot simply to make a harmonic formula work. For complete section trips, include stopping time in the measured travel time; for broader trajectory data, define the observation region and total distance/time appropriately.
Can I use N − 1 in the variance formulas?
Not without accounting for the normalization change. The identities and calculator here use descriptive population-style moments of the supplied observations. An unbiased statistical variance estimator has a different purpose and normalization.
Does one formula work for both σt² and σs²?
No. The subscripts identify different averaging weights and mean values. Keep the definitions attached to each formula; time-sample and spatial variances are not interchangeable.
Sources and reading
The worked examples, calculator and explanations are original CivilEase material developed from the supplied study notes and checked against the teaching references below.
- FHWA Data Quality White Paper, section 4.3.2: Speed — point sampling, time mean and density weighting.
- FHWA Traffic Flow Theory, Chapter 2: Traffic Stream Characteristics — equal-distance speed aggregation, spatial snapshots and definition limitations; archived theoretical reference.
- IIT Bombay / Tom V. Mathew: Fundamental Relations of Traffic Flow — speed-class derivation using spatial density proportions.

0 Comments