Timing spread and gain-offset estimator covariance (source code)

= Timing spread and gain-offset estimator covariance

\b[Timing spread and gain-offset estimator covariance] describes how delivery durations affect both precision and correlation when a known <volume> calibrates an integrated <volumetric flow rate> sensor. In the model $y_i=gV_0+bT_i+\epsilon_i$, assume $V_0$ and durations $T_i$ are known and independent <volume> errors have common <variance> $s^2$. Define $S_{TT}=\sum_i(T_i-\overline T)^2$.

The <least squares> slope estimates offset $b$, while the intercept divided by $V_0$ estimates gain $g$. Their <covariance> is
$$
\operatorname{Var}(\widehat b)=\frac{s^2}{S_{TT}},\qquad
\operatorname{Var}(\widehat g)=\frac{s^2}{V_0^2}\left(\frac1n+\frac{\overline T^2}{S_{TT}}\right),\qquad
\operatorname{cov}(\widehat g,\widehat b)=-\frac{s^2\overline T}{V_0S_{TT}}.
$$
The negative <covariance> reflects a tradeoff: a larger fitted offset can be compensated by a smaller gain while preserving responses near the middle of the observed durations.

For an original design with $V_0=3$ L, durations 1 and 6 s, and $s=0.010$ L, the <standard uncertainties> are approximately 0.00283 L/s for offset and 0.00406 for gain. Their correlation is about $-0.814$. Moving the second duration to 2 s, with everything else stipulated unchanged, makes the offset uncertainty five times larger. Wider duration spread supplies more leverage for separating slope from intercept within this model.

Prediction shows why the <covariance> matters. For a new duration $T$, the fitted mean response is $\widehat y(T)=V_0\widehat g+T\widehat b$, with
$$
\operatorname{Var}[\widehat y(T)]=s^2\left[\frac1n+\frac{(T-\overline T)^2}{S_{TT}}\right].
$$
At the midpoint 3.5 s in the example, its <standard uncertainty> is $s/\sqrt2\approx0.00707$ L. Incorrectly dropping the gain-offset <covariance> would give about 0.0157 L. This is uncertainty of the fitted mean; an independent future observation adds its own error <variance>.

Centering time at $\overline T$ makes the fitted midpoint response and slope uncorrelated under the stated equal-variance model. Transforming back to physical gain restores the <covariance>, so a change of coordinates does not remove shared uncertainty. The GUM explicitly retains such <covariance> terms in propagation.<Guide to the expression of uncertainty in measurement by JCGM>[§5.2.2, equation 13, correlated-input propagation]{ref} Reference-volume uncertainty, uncertain timing and nonlinear <volumetric flow rate> response require additional terms beyond this original regression calculation.