Section 11.34

Resolution versus precision versus accuracy

Definition

Resolution, precision and accuracy are three different properties of a measurement. Resolution is the smallest change in the measured quantity that changes the reading. Precision is how closely repeated readings of the same quantity, taken under stated conditions, agree with one another. Accuracy is how closely a reading agrees with the true value of the quantity. The difference that matters: a measurement can have fine resolution and high precision while every reading is far from the true value, so neither property shows accuracy.

The idea

A program times an operation with a clock that returns a 64-bit count of nanoseconds, and whose counter really does advance once per nanosecond. A reference instrument confirms that the operation takes exactly 1 second. Repeated runs agree with one another to within a few nanoseconds, yet every reading is about 1 millisecond too long, because the inexpensive on-chip oscillator that drives the counter runs 0.1% fast. The readings are fine-grained, repeatable and wrong.

The usual picture is a target. Precision is how tightly the shots group; accuracy is how close they land to the center. A tight group far from the center is precise but not accurate. Coarse resolution is like recording each hit only by the ring it lands in, so that its position inside the ring is lost. The picture stops at the center: the center of a target is known exactly, whereas a real reference value carries its own error.

Behind the picture is a split of every error into two parts. The systematic error, also called bias, is the part that is the same in every reading taken under the same conditions: here, the 1 millisecond per second added by the fast oscillator. The random error is the part that changes from reading to reading: here, a few nanoseconds of scatter. Precision describes only the random part; accuracy needs both parts to be small. Averaging many readings shrinks the random part and leaves the bias untouched, so only a comparison with a reference can reveal a bias.

How it works

Each property has its own cause and its own test.

A precision figure needs its conditions. Repeats on one board within one minute, called repeatability conditions §11.43, usually scatter less than repeats on different boards, days or temperatures, called reproducibility conditions. The three definitions follow the International Vocabulary of Metrology, the reference dictionary of measurement terms, which calls the closeness of the long-run average of the readings to the true value trueness.

Worked example

Three runs of the 1-second operation report 1,001,000,012, 1,001,000,009 and 1,001,000,015 nanoseconds, against a true duration of 1,000,000,000 nanoseconds. The counter advances once per nanosecond, so the resolution is 1 nanosecond. Write each reading as 1,001,000,000 plus a remainder; the remainders are 12, 9 and 15 nanoseconds.

Precision. The mean of the remainders is (12+9+15)/3=36/3=12(12 + 9 + 15)/3 = 36/3 = 12, so the mean reading is 1,001,000,012 nanoseconds. The deviations from the mean are 12−12=012 - 12 = 0, 9−12=−39 - 12 = -3 and 15−12=315 - 12 = 3. Their squares sum to 0+9+9=180 + 9 + 9 = 18. Dividing by n−1=2n - 1 = 2, where n=3n = 3 is the number of readings, gives 9, and the square root of 9 gives a standard deviation of 3 nanoseconds.

Accuracy. The error of the mean reading is 1,001,000,012−1,000,000,000=1,000,0121{,}001{,}000{,}012 - 1{,}000{,}000{,}000 = 1{,}000{,}012 nanoseconds, about 1 millisecond. Of that, 1,000,000 nanoseconds is the rate error: 0.1% of 1,000,000,000. The other 12 nanoseconds are too large to be random scatter, because the standard error §11.15 of a mean of three readings, the standard deviation divided by 3\sqrt{3}, is only 3/3≈1.73/\sqrt{3} \approx 1.7 nanoseconds. They are a second systematic error, such as the fixed cost of reading the clock. Calibration against the reference finds both errors: dividing by 1.001 and subtracting 12 nanoseconds gives 1,001,000,012/1.001−12≈1,000,000,0001{,}001{,}000{,}012 / 1.001 - 12 \approx 1{,}000{,}000{,}000 nanoseconds.

Coarse resolution. A second clock function also returns nanoseconds but is updated only once per 1-millisecond operating-system tick, so every value it returns is a multiple of 1,000,000 nanoseconds. An operation that lasts 0.3 millisecond and starts just after a tick ends before the next tick and reads as 0. Twenty such runs all read 0. That spread of zero looks like perfect precision, but it only shows that the variation is smaller than the 1-millisecond resolution.

Stated precisely

Let xx be the true value of the measured quantity, and let y1,…,yny_1, \dots, y_n be nn readings of it taken under stated conditions. The error of reading ii is ei=yi−xe_i = y_i - x, which the usual error model writes as ei=b+εi,e_i = b + \varepsilon_i, where the bias bb is the same for every reading under those conditions, and the random error εi\varepsilon_i varies from reading to reading with long-run average 0 and standard deviation σ\sigma.

The mean of nn readings has error b+ε‾b + \bar\varepsilon, where ε‾\bar\varepsilon is the average of the nn random errors. If the random errors are independent, the standard deviation of ε‾\bar\varepsilon is σ/n\sigma/\sqrt{n}, so averaging shrinks the random part toward 0 and leaves bb unchanged. In the example, b≈1,000,012b \approx 1{,}000{,}012 nanoseconds and σ≈3\sigma \approx 3 nanoseconds, so the root-mean-square error is 10000122+32≈1,000,012\sqrt{1000012^2 + 3^2} \approx 1{,}000{,}012 nanoseconds: the bias is essentially the whole error. These statements assume a bias that stays constant under the stated conditions (for example, an oscillator whose rate does not change with temperature during the runs), random errors that are independent of one another, and a reference value known with an error much smaller than the errors studied.

Limits and common mistakes

Digits are not resolution. A 64-bit count of nanoseconds, or a floating-point number §4.49 with 15 significant digits, says how finely a value is written, not how finely the instrument tells values apart. Printing more decimal places changes none of the three properties.

In computing, “precision” also means the number of digits a number format holds, as in double-precision floating point. That meaning describes the representation of a number and is closer to resolution than to the measurement meaning.

Zero spread does not show high precision. When the random variation is smaller than the resolution, every reading falls on the same step, and the true value is known only to within about one step.

A clock’s datasheet usually states its accuracy as a bound on its rate error in parts per million (ppm). A 20-ppm oscillator can gain or lose up to 20×10−6×86,400s=1.72820 \times 10^{-6} \times 86{,}400\ \text{s} = 1.728 seconds per day. The time error from a rate error grows in proportion to the interval measured, so it dominates long intervals, while resolution and the cost of reading the clock dominate short ones.

Accuracy belongs to the whole measurement method, not to the clock alone: where the timestamps are taken, what the interval includes and the time added by the measurement itself (instrumentation overhead §11.32) all enter the error. State accuracy as a number, such as an error bound or a measurement uncertainty §11.33, not as the word “accurate”.

Questions answered

Can a nanosecond-valued clock be inaccurate by milliseconds?

Yes. A clock that reports time in nanoseconds can be wrong by milliseconds, because the unit of its value fixes only how finely the value is written. The unit says nothing about the clock’s resolution (the smallest change that alters its reading), its precision (how closely repeated readings agree) or its accuracy (how close its readings are to true time). Common causes of millisecond errors are a counter that advances only once per 1-millisecond operating-system tick, so that every value is a multiple of 1,000,000 nanoseconds; an oscillator that runs 0.1% fast, which adds 1 millisecond to every second measured; a wall clock §9.36, set to calendar time, that is milliseconds away from true time after synchronization over a network; and timestamps taken at the wrong moments.

Repeated readings can agree to within a few nanoseconds and still share the same millisecond error, because a systematic error is the same in every reading and averaging does not remove it. Only calibration, a comparison with a reference whose own error is known, establishes how accurate the clock is.

Related entries: Measurement uncertainty (§11.33), Counter quantization (§11.35), Calibration (§11.42), Reproducibility versus repeatability (§11.43), Variance and standard deviation (§11.14), Clock source and drift (§6.18).