NivaarExam PrepOfficial exam papers ↗

22-Agric-A5 Principles of Instrumentation · May 2016

Question 7 of 7: Calibration-Curve Fitting and Error Models

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Paper format. 04-Agric-A5 Principles of Instrumentation, National Exams May 2016 — a three-hour open-book exam; any non-communicating calculator is permitted. Questions 1 and 2 are compulsory (20 marks each); candidates then choose any three (3) of Questions 3-7 (20 marks each) for a 100-mark paper. All seven questions are worked here.

Reference texts. E.O. Doebelin, Measurement Systems: Application and Design, 5th ed. (calibration, standards, static/dynamic sensor characteristics, second-order step response, sampling and ADCs); J.P. Bentley, Principles of Measurement Systems, 4th ed. (accuracy vs. precision, error propagation, signal conditioning); P. Horowitz and W. Hill, The Art of Electronics, 3rd ed. (Johnson noise, CMRR, ADC architectures, anti-aliasing, op-amp signal conditioning); J. Fraden, Handbook of Modern Sensors: Physics, Designs, and Applications, 5th ed. (thermistors, thermocouples, capacitive and photo sensors).

Question 7: Calibration-Curve Fitting and Error Models (20 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Reading the two error models. Part (c)'s $\varepsilon+y=ax^b$ puts the error $\varepsilon$ in as an additive term of fixed absolute size, independent of the reading — equivalently $y=ax^b-\varepsilon$, and below it is written in the usual form $y=ax^b+E$ (the sign of a zero-mean error is immaterial). Part (d)'s $\varepsilon y=ax^b$ puts the error in multiplicatively, so it scales with the reading — equivalently $y=ax^b\cdot E$ with $E=1/\varepsilon$. It is that additive-vs-multiplicative distinction, not the sign or which side the error is written on, that decides whether the log transform is valid.

a) The cubic $x=a+by+cy^2+dy^3$ is called "general purpose" because it makes no assumption about the sensor's actual underlying physics — it is not derived from any specific transduction mechanism, unlike, say, the Pitot-tube square-root law or the RTD's near-linear resistance-temperature relation. By the Weierstrass approximation theorem, a polynomial of sufficiently high order can approximate any smooth, continuous function arbitrarily closely over a finite range, so this same functional form (with fitted coefficients $a,b,c,d$) can be applied to essentially any well-behaved sensor's calibration curve — linear, gently curved, or with an inflection — without needing a different, sensor-specific model equation for each one.

b) Ordinary least squares assumes the error lives entirely in $x$, the sensor's measured output (the dependent/response variable in the fitted equation) — not in $y$, the quantity being measured (treated as the known, exact independent variable, e.g. a precisely-set calibration standard). The fit minimizes the sum of squared vertical deviations between each measured $x_i$ and the polynomial's predicted value at the corresponding known $y_i$, which is only statistically correct when all the random error is concentrated in that measured $x$.

c) When the error is additive and independent of $x$ (a constant absolute error $E$ added directly to $y$, i.e. $y=ax^b+E$, not compounded with the value of $y$), taking $\log(y)$ does not preserve that simple structure: $\log(ax^b+E)\ne\log(ax^b)+\log(E)$, so the transform mixes the error into the fitted model in a non-linear way. Where $y$ is small, a fixed absolute error $E$ becomes a large relative change in $\log(y)$; where $y$ is large, the same fixed $E$ barely moves $\log(y)$ at all. The log-transformed least-squares fit therefore ends up implicitly weighting the low-$y$ data points far more heavily than the high-$y$ points — the opposite of the uniform (constant-variance) weighting ordinary least squares assumes — so the transform is not strictly valid for this error model; a fit should instead be done directly on the untransformed $y=ax^b$ (nonlinear regression), or the log-space fit re-weighted to compensate.

d) When the error is proportional to $y$ itself (a multiplicative error, $y=ax^b\cdot E$, so the error grows with the size of the reading), the logarithm turns that multiplication into addition: $$\log(y)=\log(a)+b\log(x)+\log(E).$$ Since $E$ scales with $y$, $\log(E)$ becomes an error term whose size in log-space is roughly constant regardless of $y$'s magnitude (a fixed percentage error becomes a fixed absolute error once logged). That is exactly the constant-variance, additive-error condition ordinary least squares requires, so the log transform is valid here — indeed this proportional-error case is precisely the situation the log transform was designed to handle, both linearizing the model and correctly equalizing the error's influence across the whole data range.

e) RMS error is an absolute error metric, expressed in the same physical units as $y$ itself — appropriate exactly when the underlying error is itself of roughly constant absolute size across the range (case c), in which case one RMS number meaningfully summarizes the typical deviation everywhere on the curve. In case d, the error scales with $y$, so a single absolute RMS number is nearly meaningless on its own — the same numerical RMS error might represent an excellent fit at large $y$ but a terrible one at small $y$. A signal-to-noise ratio (error expressed as a fraction/percentage of the signal level) instead stays roughly constant across the whole range whenever the error genuinely scales with $y$, so it is the metric that correctly and consistently characterizes a proportional-error sensor.

Back to the paper →