Files
ML-Porosity/paper/sections/A_proofs.tex
hola2k4 8d5befb412 Rewrite the manuscript for outside readers; move formal results to App. A
Follow the style of the abstract in the remaining sections: results in
words first, conditions up front, physical quantities instead of codes.
A survey of Computers & Geosciences papers is recorded in
docs/research/paper-style-survey.md.

Replace repository codes with descriptive names in the text, tables and
captions (10 dB, half-anchor, SMC mean, SMC bank, calibrated sonic);
configs, outputs and code keep the codes, mapped in paper/README.md.
Remove symbols that carried two meanings.

Put Methods before Theory. Section 5 now states each result in words and
Appendix A holds the formal statements with their proofs. Add tables of
results and symbols, a table of failures with causes and lessons, a
worked example in Sec. 6.6 and practical advice in Sec. 7. Move the
protocol record and secondary results to a new Appendix C. The main text
falls from about 20,600 to 15,400 words.

Corrections from two rounds of review: state both pass rules (the bank
claim has no margin), compare against the best deterministic tie, define
calibration per function, drop the uninterpretable Berkson bounds at
c = 2 from the table, define the SNR and noise, disclose the sigma_b
mismatch, and correct 29-35% to 30-35%. Drop tab:p1 and fig:f3vol.

No verdict, threshold or protocol changes. The figure scripts now draw
the new names, but the figures still need regenerating on a machine
with outputs/*/summary; red notes in the captions mark this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:34:13 +07:00

279 lines
29 KiB
TeX

\section{Formal results and proofs}
\label{app:proofs}
This appendix states the results of Section~\ref{sec:theory} formally, in the order of that section, and proves them. The Fourier transform is $\hat g(f) = \int g(t)\,e^{-i2\pi f t}\dd t$, $T_\beta h(t) = h(t-\beta)$ is a time shift, and $a_b = Ba$ is the seismic-band part of $a$. In the experiments $B$ is a fourth-order Butterworth filter applied forward and backward (zero phase). Its response is real and non-negative, so every result below holds with $S$ replaced by $|H_B|^2 S$.
\subsection{Blur}
\begin{proposition}[Blur]
\label{prop:blur}
Assume (A1) that for every $t$, $\delta(t)$ is independent of $(X, y(\cdot))$ with distribution $p_t$, and (A2) that $\sup_t\E[y(t)^2] < \infty$. Then the MSE-optimal predictor of the observed label is
\begin{equation}
\tilde m(t) = \E[\tilde y(t)\mid X] = \int p_t(d)\, m(t+d)\dd d .
\end{equation}
If $p_t \equiv p$, then $\tilde m$ is $m$ passed through a linear time-invariant filter with frequency response equal to the characteristic function of $\delta$,
\begin{equation}
P(f) = \E\big[e^{i2\pi f\delta}\big], \qquad \delta \sim \N(\mu_\delta, \sigma^2) \;\Rightarrow\; P(f) = e^{i2\pi f\mu_\delta}\, e^{-2\pi^2\sigma^2 f^2}.
\label{eq:transfer}
\end{equation}
\end{proposition}
\noindent\emph{Proof.} By (A1), $\E[y(t+\delta(t))\mid X, \delta(t) = d] = \E[y(t+d)\mid X] = m(t+d)$. Taking the expectation over $\delta(t) \sim p_t$, which is independent of $X$, and exchanging the order of integration (Fubini, using (A2)) gives $\tilde m(t) = \int p_t(d)\, m(t+d)\dd d$. If $p_t \equiv p$, the Fourier transform of $m(\cdot + d)$ is $e^{i2\pi f d}\hat m(f)$, so $\tilde m$ has transform $P(f)\hat m(f)$ with $P(f) = \E e^{i2\pi f\delta}$. For $\delta \sim \N(\mu_\delta, \sigma^2)$, $P$ is the Gaussian characteristic function evaluated at $2\pi f$. \hfill$\square$
If the marginal distribution changes slowly with $t$ (for example, drift that grows with depth), $\tilde m$ is a time-varying filter that is locally $P$ with $\sigma(t)$.
\subsection{Seismic-band bounds}
\begin{corollary}[Seismic-band bounds]
\label{cor:band}
Let $\langle h\rangle = \int_{|f|\ge f_c} h\, S_{m}\dd f \big/ \int_{|f|\ge f_c} S_{m}\dd f$. Then
\begin{equation}
\frac{\sd \tilde m_b}{\sd y_b} \le \sqrt{\langle |P|^2\rangle} \le \sup_{|f|\ge f_c}|P(f)|,
\qquad
\PCC_b(\tilde m) = \kappa(P)\,\PCC_b(m), \quad \kappa(P) = \frac{\langle \operatorname{Re} P\rangle}{\sqrt{\langle|P|^2\rangle}} \le 1 ,
\end{equation}
with equality in $\kappa$ if and only if $P$ is a positive constant on the support of $S_{m_b}$.
\end{corollary}
\noindent\emph{Proof.} Let $e = y - m$. Since $\E[e(t)\mid X] = 0$ and $m(t')$ is a function of $X$, $\Cov(e(t), m(t')) = 0$ for all $t, t'$. Hence $S_{ym} = S_m$ and $S_y = S_m + S_e$. The band operator $B$ commutes with the filter $P$. Because $\delta$ is real, $P(-f) = P(f)^*$. Therefore
\begin{equation*}
\Var \tilde m_b = \int_{|f|\ge f_c} |P|^2 S_m \dd f, \qquad \Cov(\tilde m_b, y_b) = \int_{|f|\ge f_c} \operatorname{Re}P\, S_m \dd f .
\end{equation*}
With $\langle\cdot\rangle$ the average weighted by $S_{m_b}$,
\begin{equation*}
\frac{\sd\tilde m_b}{\sd y_b} = \sqrt{\langle|P|^2\rangle}\,\frac{\sd m_b}{\sd y_b} \le \sqrt{\langle|P|^2\rangle} \le \sup_{|f|\ge f_c}|P(f)|,
\qquad
\PCC_b(\tilde m) = \frac{\langle\operatorname{Re}P\rangle}{\sqrt{\langle|P|^2\rangle}}\,\frac{\sd m_b}{\sd y_b},
\end{equation*}
and $\PCC_b(m) = \sd m_b/\sd y_b \le 1$ because $\Cov(m_b, y_b) = \Var m_b$. By Cauchy--Schwarz, $\kappa(P) \le \langle|P|\rangle/\sqrt{\langle|P|^2\rangle} \le 1$, with equality if and only if $P$ is a positive constant on the support of $S_{m_b}$. At each frequency with $P(f) \ne 0$ the coherence is $|S_{\tilde m y}|^2/(S_{\tilde m}S_y) = S_m/S_y$, which does not depend on $P$. If $\mu_\delta \ne 0$, $\operatorname{Re}P = e^{-2\pi^2\sigma^2 f^2}\cos(2\pi f\mu_\delta)$, which lowers $\kappa$ further. \hfill$\square$
\subsection{Variance matching}
\begin{corollary}[Variance matching rescales amplitude only]
\label{cor:var}
Consider $J(h) = \E\|h - \tilde y\|^2 + \Psi(\E h, \Var h)$ over predictors $h$ that are functions of $X$, where $\Psi$ is any penalty on the mean and variance of the prediction (for example a penalty on the standard-deviation ratio). Every minimizer satisfies $h^\star - \E h^\star = a\,(\tilde m - \E\tilde m)$ for some $a \ge 0$.
\end{corollary}
\noindent\emph{Proof.} Moments are averaged over $t$ in the window, and $h$ ranges over functions of $X$ with finite variance. Since $\tilde m = \E[\tilde y\mid X]$, $\E\|h - \tilde y\|^2 = \E\|h - \tilde m\|^2 + \E\|\tilde m - \tilde y\|^2$. Fix $\E h$ and $\Var h = v$. Then $\E\|h - \tilde m\|^2 = (\E h - \E\tilde m)^2 + v + \Var\tilde m - 2\Cov(h, \tilde m)$, which is smallest when the covariance is largest. By Cauchy--Schwarz, $\Cov(h, \tilde m) \le \sqrt{v\Var\tilde m}$, with equality if and only if $h - \E h = a(\tilde m - \E\tilde m)$ with $a = \sqrt{v/\Var\tilde m}$. Optimizing over $(\E h, v)$ then only selects $a$ and a constant. \hfill$\square$
For $a > 0$, $h^\star$ has the same PCC and band PCC as $\tilde m$, and its in-band spectrum is $a^2|P|^2 S_m$. The statement holds at the population level for a sufficiently rich model class.
\subsection{Identifiability}
Consider $N$ training wells with seismic $X_w$, depth logs $\phi_w$ and warps $u_w = (b_w, g_w)$ (Section~\ref{sec:method:prior}). Let $y^{u}(t) = (\aaf\phi)(z_u(t))$ be the label under warp $u$, where $z_u$ inverts $t_u$ and $\aaf$ is an anti-alias filter. Let $e_b$ be the direction that adds the same $\beta$ to every $b_w$. The joint MAP objective over network parameters $\theta$ and warps $\mathbf{u}$ is
\begin{equation}
\mathcal J(\theta, \mathbf u) = \sum_w \Big[\mathcal L_w(\theta; y_w^{u_w}) + \log p(u_w) + \sum_k \log \N\big(t_{wk};\, t_{u_w}(z_{wk}),\, \sigma_a^2\big)\Big],
\end{equation}
with Gaussian log-likelihood $\mathcal L_w$ over windows and anchors $(z_{wk}, t_{wk})$. The network outputs $\mu_\theta$ and $\sigma_\theta$ are those of Section~\ref{sec:method:rml}.
\begin{proposition}[Identifiability]
\label{prop:ident}
Assume (A3) that the model class is closed under output shifts: for each $\theta$ and each shift $\beta$ by a whole number of samples with $|\beta| \le \beta_{\max}$ there is $\theta'$ with $\mu_{\theta'} = T_\beta \mu_\theta$ and $\sigma_{\theta'} = T_\beta\sigma_\theta$. Then, up to window-edge effects:
\begin{enumerate}
\item[(a)] without anchors, with a flat prior on $b$ and no seismic tie term, $\mathcal J(\theta', \mathbf u + \beta e_b) = \mathcal J(\theta, \mathbf u)$, so the objective has a ridge in $\beta$ shared by all wells;
\item[(b)] a prior $b_w \sim \N(0, \sigma_b^2)$ adds curvature $N/\sigma_b^2$ along the ridge;
\item[(c)] anchors with finite $\sigma_a$ add curvature $\sum_w K_w/\sigma_a^2$, where $K_w$ is the number of anchors at well $w$, so that the spread of $\beta$ along the ridge, with the other parameters held fixed, is
\begin{equation}
\sd(\beta) \approx \Big(\frac{\sum_w K_w}{\sigma_a^2} + \frac{N}{\sigma_b^2}\Big)^{-1/2} \approx \frac{\sigma_a}{\sqrt{\sum_w K_w}} .
\end{equation}
\end{enumerate}
\end{proposition}
\noindent\emph{Proof.} Since $t_{u + \beta e_b}(z) = t_u(z) + \beta$, we have $z_{u+\beta e_b}(t) = z_u(t - \beta)$ and hence $y^{u + \beta e_b} = T_\beta y^u$. By (A3), $\mu_{\theta'} = T_\beta\mu_\theta$ and $\sigma_{\theta'} = T_\beta\sigma_\theta$. The Gaussian log-likelihood on a window $I$ is $\sum_{i\in I}\log\N(y(t_i - \beta); \mu(t_i-\beta), \sigma^2(t_i-\beta))$, which is the log-likelihood on the window $I - \beta$. Summed over windows that tile the trace, the two objectives differ only at edge samples. The log-sum-exp of RML preserves this invariance, because every bank member is shifted by the same amount. The prior on $g$ is unchanged, because $g$ is unchanged. This proves (a). Parts (b) and (c) follow by direct computation from $t_{u+\beta e_b}(z_{wk}) = t_{u_w}(z_{wk}) + \beta$. The prior adds $-\sum_w (b_w + \beta)^2/(2\sigma_b^2)$, with curvature $N/\sigma_b^2$. The anchors add $-\sum_{w,k}(t_{wk} - t_{u_w}(z_{wk}) - \beta)^2/(2\sigma_a^2)$, with curvature $\sum_w K_w/\sigma_a^2$. The expression for $\sd(\beta)$ is the inverse square root of the total curvature, that is, a quadratic approximation along the ridge with the other parameters fixed. In a Gaussian approximation this conditional variance is at most the marginal variance of $\beta$, by the law of total variance. \hfill$\square$
\subsection{Two error structures}
With $D$, $\hat u$, $\delta$, $\varepsilon$ and $Q$ as in Section~\ref{sec:theory:post}, eq.~\eqref{eq:twoerrors}:
\begin{proposition}[Two error structures]
\label{prop:tie}
Assume (A2) for $y$ and $\tilde y$.
\begin{enumerate}
\item[(a)] \emph{Classical error.} If $\delta(t)$ is independent of $y(\cdot)$ given $X$, with conditional distribution $p_t(\cdot\mid X)$, then
\begin{gather*}
\tilde m(t) = \int p_t(d\mid X)\, m(t+d)\dd d, \\
\Var\big(\tilde y(t)\mid X\big) = \int p_t(d\mid X)\Var\big(y(t+d)\mid X\big)\dd d + \Var_{p_t}\!\big[m(t+d)\big].
\end{gather*}
\item[(b)] \emph{Berkson error.} If $\varepsilon(t)$ is independent of $D$ given $X$, with conditional distribution $q_t(\cdot\mid X)$, then
\begin{gather*}
m(t) = \int q_t(e\mid X)\, \tilde m(t+e)\dd e, \\
\Var\big(y(t)\mid X\big) = \int q_t(e\mid X)\Var\big(\tilde y(t+e)\mid X\big)\dd e + \Var_{q_t}\!\big[\tilde m(t+e)\big].
\end{gather*}
\end{enumerate}
If $p_t$ and $q_t$ do not depend on $t$, then, averaged over the window and up to edge terms, the point label has the larger conditional variance under (a) and the smaller under (b). If they depend on neither $t$ nor $X$, then $\tilde m$ is $m$ filtered by $P$ under (a), and $m$ is $\tilde m$ filtered by $Q$ under (b). For zero-mean Gaussian errors with variance $\sigma^2$, the transfer from $m$ to $\tilde m$ is $e^{-2\pi^2\sigma^2 f^2}$ under (a) and $e^{+2\pi^2\sigma^2 f^2}$ under (b).
\end{proposition}
The Gaussian Berkson case is self-consistent only if $S_m$ decays faster than $e^{-4\pi^2\sigma^2f^2}$; otherwise $\tilde m$ would have infinite variance, contrary to (A2).
\noindent\emph{Proof.} (a) Conditional on $X$ and $\delta(t) = d$, independence gives $\E[y(t+d)\mid X, \delta(t) = d] = m(t+d)$ and $\E[y(t+d)^2\mid X, \delta(t) = d] = \E[y(t+d)^2\mid X]$. Integrating over $p_t(\cdot\mid X)$ (Fubini, using (A2)) gives $\tilde m(t)$ and $\E[\tilde y(t)^2\mid X] = \int p_t(d\mid X)\{\Var(y(t+d)\mid X) + m(t+d)^2\}\dd d$. Subtracting $\tilde m(t)^2$ gives the variance.
(b) $\tilde y$ is a function of $D$ because $\hat u$ is. Since $\varepsilon(t)$ is independent of $D$ given $X$, $\E[y(t)\mid D] = \E[\tilde y(t + \varepsilon(t))\mid D] = \int q_t(e\mid X)\,\tilde y(t+e)\dd e$, and in the same way $\E[y(t)^2\mid D] = \int q_t(e\mid X)\,\tilde y(t+e)^2\dd e$. Because $X$ is a function of $D$, the tower property gives $m(t) = \E\big[\E[y(t)\mid D]\mid X\big] = \int q_t(e\mid X)\,\tilde m(t+e)\dd e$, and the same for the second moment. Subtracting $m(t)^2$ gives the variance.
If $p_t = p(\cdot\mid X)$ does not depend on $t$, the window average of $\int p(d\mid X)\Var(y(t+d)\mid X)\dd d$ is $\int p(d\mid X)\,|W|^{-1}\!\int_{W+d}\Var(y(s)\mid X)\dd s\dd d$, which equals the window average of $\Var(y\mid X)$ up to contributions from the edges of the window $W$. Since $\Var_p[m(t+d)] \ge 0$, the window average of $\Var(\tilde y\mid X)$ is at least that of $\Var(y\mid X)$. Case (b) is the same with $y$ and $\tilde y$ exchanged. The Fourier statements follow as in Proposition~\ref{prop:blur}. For zero-mean Gaussian $\varepsilon$, $Q = e^{-2\pi^2\sigma^2 f^2} > 0$, so the transform of $\tilde m$ is $\hat m/Q$. \hfill$\square$
\subsection{Calibrated bank}
\begin{proposition}[Calibrated bank]
\label{prop:bank}
Call a bank $\{(u_s, \pi_s)\}$ calibrated for a function $G$ if
\begin{equation*}
\sum_s \pi_s G(u_s, D) = \E[G(u^\star, D)\mid D] .
\end{equation*}
\begin{enumerate}
\item[(a)] If the bank is calibrated for $G(u, D) = y^{u}(t)$ at every $t$, the mean label $\bar y = \sum_s \pi_s y^{u_s}$ satisfies $\bar y(t) = \E[y(t)\mid D]$ and $\E[\bar y(t)\mid X] = m(t)$;
\item[(b)] If it is calibrated for the window log-likelihood \eqref{eq:rml} of every network $(\mu_\theta, \sigma_\theta)$ that depends on the data only through $X$, then, for those networks, $\E\big[\sum_s \pi_s \ell_s\big] = \E[\ell^\star]$, where $\ell^\star$ is the log-likelihood of the label at the true warp.
\end{enumerate}
Under (b) the $\lambda \to 0$ limit of RML (Lemma~\ref{lem:sandwich}) has the population minimizer of training on the true labels, $\mu = m$ and $\sigma^2 = \Var(y\mid X)$, and under (a) MSE on the mean label has the population minimizer $\mu = m$.
\end{proposition}
Because the log-likelihood is quadratic in the label, (b) holds whenever the bank matches the posterior mean and variance of the label at every $t$.
\noindent\emph{Proof.} (a) Take $G(u, D) = y^u(t)$, which depends on $D$ through the logs. Calibration gives $\bar y(t) = \E[y^{u^\star}(t)\mid D] = \E[y(t)\mid D]$, and the tower property gives $\E[\bar y(t)\mid X] = m(t)$.
(b) Take $G(u, D) = \ell\big(y^u; \mu_\theta(X), \sigma_\theta(X)\big)$, a function of $(u, D)$ because $X$ is a function of $D$. Calibration gives $\sum_s \pi_s\ell_s = \E[\ell^\star\mid D]$, and taking expectations gives the claim. By Lemma~\ref{lem:sandwich}, $\RML_\lambda \to -\frac1n\sum_s\pi_s\ell_s$ as $\lambda \to 0$, so for every $\theta$ the limit has the expectation of the Gaussian negative log-likelihood on the true labels. Over functions of $X$, the latter is minimized sample by sample at $\mu_i = \E[y(t_i)\mid X]$ and $\sigma_i^2 = \Var(y(t_i)\mid X)$. For the MSE, $\E[\bar y - m\mid X] = 0$ by (a), so $\E(h - \bar y)^2 = \E(h - m)^2 + \E(m - \bar y)^2$ for every function $h$ of $X$.
Expanding $y^{u}$ formally around $\bar u = \sum_s\pi_s u_s$,
\begin{equation*}
\bar y - y^{\bar u} = \tfrac12 \sum_s \pi_s\, (u_s - \bar u)^\top \nabla_u^2 y^{\bar u}\, (u_s - \bar u) + O\Big(\sum_s \pi_s\|u_s - \bar u\|^3\Big),
\end{equation*}
so the two labels agree to first order in the posterior spread. This is a second-order Taylor expansion in $u$, formal because $u$ contains the drift function $g$; the first-order term vanishes because $\sum_s \pi_s (u_s - \bar u) = 0$. \hfill$\square$
\subsection{Two modes}
\begin{corollary}[Two modes]
\label{cor:twomode}
Let the error ($\delta$ under (a), $\varepsilon$ under (b)) be constant over the window and equal to $\pm\Delta/2$ with probability $\frac12$ each, independently of $(X, y)$ under (a) and of $D$ under (b). Then $P(f) = Q(f) = \cos(\pi f\Delta)$, and under either structure the transfer from $m$ to $\tilde m$ is negative for $1/(2\Delta) < |f| < 3/(2\Delta)$: there the point label trains the network towards the wrong sign. A Gaussian error with the same variance $\Delta^2/4$ has $P(f) = e^{-\pi^2\Delta^2f^2/2} > 0$ at every frequency. The mean label of a calibrated bank has transfer 1. Under (a), take the bank of the point label shifted by $\pm\Delta/2$ with equal weights. The population optimum of MSE on its mean label, which is also that of RML on this bank as $\lambda \to 0$, has transfer $\cos^2(\pi f\Delta) \ge 0$. This bank contains the label at the true warp, but it is not calibrated: its equal weights are not the posterior probabilities of its two members.
\end{corollary}
\noindent\emph{Proof.} The characteristic function of $\pm\Delta/2$ with equal probabilities is $\frac12\big(e^{i\pi f\Delta} + e^{-i\pi f\Delta}\big) = \cos(\pi f\Delta)$, which is negative for $\pi/2 < \pi|f|\Delta < 3\pi/2$. Under (a) the transfer from $m$ to $\tilde m$ is $P$. Under (b), $\hat m = Q\,\hat{\tilde m}$, so the transfer is $1/Q$ wherever $Q \ne 0$ and has the sign of $Q$; $Q$ has no zero inside the open interval $1/(2\Delta) < |f| < 3/(2\Delta)$, and at its zeros the identity forces $\hat m = 0$. A zero-mean Gaussian with variance $\Delta^2/4$ has characteristic function $e^{-2\pi^2(\Delta^2/4)f^2}$. The calibrated bank is covered by Proposition~\ref{prop:bank}(a). For the shifted bank, $\bar y(t) = \frac12\big[\tilde y(t + \Delta/2) + \tilde y(t - \Delta/2)\big]$, so $\E[\bar y\mid X]$ is $\tilde m$ filtered by $\cos(\pi f\Delta)$, that is, $m$ filtered by $\cos^2(\pi f\Delta)$. This is the population minimizer of MSE on $\bar y$ and, as in the proof of Proposition~\ref{prop:bank}(b), of the $\lambda \to 0$ limit of RML on the bank, because the bank average of the Gaussian negative log-likelihood is minimized in $\mu$ at $\bar y$. A calibrated bank would have transfer 1 by Proposition~\ref{prop:bank}(a), so this bank is not calibrated. \hfill$\square$
\subsection{Finite tempering and the population gain}
\begin{remark}[$\lambda > 0$]
\label{rem:lambda}
Expanding the cumulant generating function in \eqref{eq:rml},
\begin{equation*}
\RML_\lambda = -\frac1n\Big[\sum_s \pi_s\ell_s + \frac\lambda2 \Var_\pi(\ell) + O(\lambda^2)\Big].
\end{equation*}
The second term rewards predictors that fit some bank members much better than others. For $\lambda > 0$ the responsibilities of Lemma~\ref{lem:grad} shift weight towards the members that agree with the current network, which amounts to an implicit re-registration, and the population minimizer is in general no longer $(m, \Var(y\mid X))$.
\end{remark}
Because $\E[y - m\mid X] = 0$, every predictor $h$ that depends on the data only through $X$ satisfies
\begin{equation*}
\E|B(h - y)|^2 = \E|B(m - y)|^2 + \E|B(h - m)|^2 ,
\end{equation*}
which is the identity behind \eqref{eq:rhostar}.
\noindent\emph{Proof.} For a finite bank, $\log\E_\pi e^{\lambda\ell} = \lambda\E_\pi\ell + \frac{\lambda^2}{2}\Var_\pi\ell + O(\lambda^3)$; dividing by $-\lambda n$ gives the expansion in Remark~\ref{rem:lambda}.
$B$ is linear, so $B(h - y) = B(h - m) + B(m - y)$. Here $B(h - m)$ is a function of $X$ and $\E[B(m - y)\mid X] = B\,\E[m - y\mid X] = 0$, so the cross term vanishes. Setting $h = \tilde m$ gives \eqref{eq:rhostar}. The transform of $\tilde m - m$ is $(P - 1)\hat m$ under (a) and $(1/Q - 1)\hat m$ under (b). For Gaussian errors let $x = 2\pi^2\sigma^2 f^2$. Then $(1 - e^{-x})^2 = x^2 + O(x^3)$, $(e^{x} - 1)^2 = x^2 + O(x^3)$, and their ratio is $e^{2x}$. At $\sigma = 2.5$\,ms and $f = 25$\,Hz, $e^{2x} = 1.167$. \hfill$\square$
\subsection{Coverage}
With $\mu$, $\hat\sigma^2$, $v_j$, $w_j$ and $\xi_j$ as in Section~\ref{sec:theory:cov}:
\begin{proposition}[Coverage]
\label{prop:coverage}
\begin{enumerate}
\item[(a)] For any methods $j$ and $O$, $\xi_j - \xi_O = (\Delta v - \xi_O\,\Delta w)/w_j$, with $\Delta v = v_j - v_O$ and $\Delta w = w_j - w_O$.
\item[(b)] Let $m$ and $y$ be jointly stationary, and let (A1) hold with $p_t \equiv p$ and real $0 \le P \le 1$. Compare the point label at its population optimum ($\mu = \tilde m$, $\hat\sigma^2 = \Var(\tilde y\mid X)$) with the oracle at its optimum ($\mu = m$, $\hat\sigma^2 = \Var(y\mid X)$). Then $\xi_O = 1$ and
\begin{equation*}
\xi_j - \xi_O = \frac{2}{w_j}\int P(1 - P)\, S_m\dd f \ \ge 0 .
\end{equation*}
\item[(c)] Under the Berkson structure of Proposition~\ref{prop:tie}(b), with $q_t$ independent of $t$ and $y$ stationary, the point label at its population optimum has $\xi_j \le 1$, up to edge terms. A calibrated bank at the $\lambda \to 0$ population optimum of Proposition~\ref{prop:bank} has $\xi = 1$.
\end{enumerate}
If $y - \mu = \hat\sigma Z/\sqrt{\xi}$ with $Z$ standard normal and independent of $\hat\sigma$, the interval $\mu \pm z \hat\sigma$ covers with probability $2\Phi(z\sqrt{\xi}) - 1$, which increases with $\xi$.
\end{proposition}
\noindent\emph{Proof.} (a) $\xi_j - \xi_O = (v_j w_O - v_O w_j)/(w_j w_O)$, and $v_j w_O - v_O w_j = \Delta v\, w_O - v_O\, \Delta w$. Dividing by $w_j w_O$ gives the identity.
(b) Let $V = \E\Var(y\mid X)$. For the oracle, $v_O = w_O = V$. By (A1) and stationarity, $\E\tilde y^2 = \E y^2 = V + \E m^2$, so $v_j = \E\tilde y^2 - \E\tilde m^2 = V + \int(1 - P^2)S_m\dd f$. By the orthogonality used for \eqref{eq:rhostar}, without the band operator, $w_j = V + \E(\tilde m - m)^2 = V + \int(1 - P)^2S_m\dd f$. Hence $\Delta v - \Delta w = \int[(1 - P^2) - (1 - P)^2]S_m\dd f = 2\int P(1 - P)S_m\dd f$, and (a) with $\xi_O = 1$ gives the result.
(c) By orthogonality, $w_j = V + \E(\tilde m - m)^2 \ge V$. By Proposition~\ref{prop:tie}(b), $\Var(y(t)\mid X) \ge \int q(e\mid X)\Var(\tilde y(t+e)\mid X)\dd e$. Averaging over the window and taking expectations as in the proof of Proposition~\ref{prop:tie}, $V \ge \E\Var(\tilde y\mid X) = v_j$, so $\xi_j \le 1$. At $\lambda \to 0$, a calibrated bank has the population optimum of the oracle (Proposition~\ref{prop:bank}), so $\xi = \xi_O = 1$.
For the coverage statement, $\Pr(|y - \mu| \le z\hat\sigma) = \Pr(|Z| \le z\sqrt\xi) = 2\Phi(z\sqrt\xi) - 1$. \hfill$\square$
\subsection{Misregistered reference}
With the reference of Section~\ref{sec:theory:ref}, let $\hat y$ and $y$ be jointly stationary with cross-spectrum $S_{\hat y y}$, defined by $\E[\hat y(t)\,y(t+\tau)] = \int S_{\hat y y}(f)\,e^{i2\pi f\tau}\dd f$.
\begin{proposition}[Misregistered reference]
\label{prop:reference}
Under these assumptions,
\begin{equation}
\E|B(\hat y - y_{\mathrm{ref}})|^2 = \E|B(\hat y - y)|^2 + 2\int_{|f|\ge f_c}\operatorname{Re}\big[(1 - Q_{\mathrm{ref}}(f))\,S_{\hat y y}(f)\big]\dd f .
\label{eq:refbias}
\end{equation}
\end{proposition}
For a symmetric error, $0 \le 1 - Q_{\mathrm{ref}} \le 2$.
\noindent\emph{Proof.} Because $B$ is linear and time-invariant and $\varepsilon_{\mathrm{ref}}$ is constant over the window, $By_{\mathrm{ref}}(t) = (By)(t + \varepsilon_{\mathrm{ref}})$. By independence and stationarity, $\E|By_{\mathrm{ref}}|^2 = \E|By|^2$ and
\begin{equation*}
\E\big[B\hat y(t)\; By(t + \varepsilon_{\mathrm{ref}})\big] = \E_{\varepsilon_{\mathrm{ref}}}\!\int_{|f|\ge f_c} S_{\hat y y}(f)\, e^{i2\pi f\varepsilon_{\mathrm{ref}}}\dd f = \int_{|f|\ge f_c} S_{\hat y y}(f)\, Q_{\mathrm{ref}}(f)\dd f .
\end{equation*}
Expanding both squares, the two MSEs differ only in the cross term, $-2\int S_{\hat y y}Q_{\mathrm{ref}}\dd f$ against $-2\int S_{\hat y y}\dd f$ over $|f| \ge f_c$. The difference is real, so it equals its real part. \hfill$\square$
\subsection{Tolerance}
\begin{corollary}[Tolerance]
\label{cor:tolerance}
For two methods 1 and 2, let $G$ be the true band-MSE advantage of method 1 and $G_{\mathrm{ref}}$ the advantage measured against $y_{\mathrm{ref}}$. Then $G_{\mathrm{ref}} - G = 2\int_{|f|\ge f_c}\operatorname{Re}\big[(1 - Q_{\mathrm{ref}})(S_{\hat y_2 y} - S_{\hat y_1 y})\big]\dd f$. Let $\hat y_1 = Hm$ and $\hat y_2 = HPm$, with real filters $0 \le H, P \le 1$: method 1 learns the oracle and method 2 the blurred optimum, both shrunk by the same finite-sample factor $H$. Then
\begin{equation*}
G = \int_{|f|\ge f_c} H(1 - P)\big[2 - H(1 + P)\big] S_m\dd f \ \ge 0,
\qquad
G_{\mathrm{ref}} = \int_{|f|\ge f_c} H(1 - P)\big[2Q_{\mathrm{ref}} - H(1 + P)\big] S_m\dd f .
\end{equation*}
For $H = 1$ and zero-mean Gaussian errors with standard deviations $\sigma$ and $\sigma_{\mathrm{ref}}$, $2Q_{\mathrm{ref}} - 1 - P = 2\pi^2f^2(\sigma^2 - 2\sigma_{\mathrm{ref}}^2) + O(f^4)$, so the measured advantage can have the sign of the true one only if $\sigma_{\mathrm{ref}} < \sigma/\sqrt2$. The condition is necessary at every frequency, not only to leading order, and it is not sufficient: the measured advantage changes sign at a reference error below $\sigma/\sqrt2$.
\end{corollary}
Shrinkage relaxes this condition, because $2Q_{\mathrm{ref}} - H(1 + P)$ grows as $H$ decreases. If method 2 is over-sharp instead, as under Berkson error, with $\hat y_2 = HRm$ and $R \ge 1$, then $G_{\mathrm{ref}} - G = 2\int_{|f|\ge f_c} H(R - 1)(1 - Q_{\mathrm{ref}})S_m\dd f \ge 0$, and the reference exaggerates the advantage of method 1.
\noindent\emph{Proof.} The expression for $G_{\mathrm{ref}} - G$ is \eqref{eq:refbias} applied to both methods. As in the proof of Corollary~\ref{cor:band}, $S_{my} = S_m$, so $S_{\hat y_1 y} = HS_m$ and $S_{\hat y_2 y} = HPS_m$. For $\hat y = Lm$ with a real filter $L$, $\E|B(\hat y - y)|^2 = \int_{|f|\ge f_c}(L^2 - 2L)S_m\dd f + \E|By|^2$. The difference between $L = HP$ and $L = H$ is $G$, and adding $G_{\mathrm{ref}} - G = -2\int_{|f|\ge f_c} H(1 - P)(1 - Q_{\mathrm{ref}})S_m\dd f$ gives $G_{\mathrm{ref}}$. Both factors of the integrand of $G$ are non-negative when $0 \le H, P \le 1$. For Gaussian errors, $P = e^{-2\pi^2\sigma^2f^2} = 1 - 2\pi^2\sigma^2f^2 + O(f^4)$ and $Q_{\mathrm{ref}} = e^{-2\pi^2\sigma_{\mathrm{ref}}^2f^2} = 1 - 2\pi^2\sigma_{\mathrm{ref}}^2f^2 + O(f^4)$, which gives the leading-order term. If $\sigma_{\mathrm{ref}} \ge \sigma/\sqrt2$, then $Q_{\mathrm{ref}} \le e^{-\pi^2\sigma^2f^2}$ and $2Q_{\mathrm{ref}} - 1 - P \le 2e^{-\pi^2\sigma^2f^2} - 1 - e^{-2\pi^2\sigma^2f^2} = -\big(1 - e^{-\pi^2\sigma^2f^2}\big)^2 \le 0$ at every $f$, so $G_{\mathrm{ref}} \le 0$ for $H = 1$. At $\sigma_{\mathrm{ref}} = \sigma/\sqrt2$ the inequality is strict wherever $S_m > 0$ in the band, so by continuity $G_{\mathrm{ref}} < 0$ also for $\sigma_{\mathrm{ref}}$ slightly below $\sigma/\sqrt2$. The over-sharp case follows by substituting $S_{\hat y_2 y} = HRS_m$. \hfill$\square$
\subsection{Lemmas of Section~\ref{sec:method:rml}}
\paragraph{Lemma~\ref{lem:s1}.} If all $\ell_s = \ell$, then $\log\sum_s\pi_s e^{\lambda\ell} = \lambda\ell$. \hfill$\square$
\paragraph{Lemma~\ref{lem:sandwich}.} Let $\Lambda(\lambda) = \log\E_\pi e^{\lambda\ell} = \lambda M(\lambda)$, and let $r_\lambda \propto \pi e^{\lambda\ell}$ be the tilted distribution. Then $\Lambda' = \E_{r_\lambda}\ell$, and $\lambda\Lambda' - \Lambda = \E_{r_\lambda}[\lambda\ell - \Lambda] = \mathrm{KL}(r_\lambda\|\pi)$. Hence $M'(\lambda) = (\lambda\Lambda' - \Lambda)/\lambda^2 = \mathrm{KL}(r_\lambda\|\pi)/\lambda^2 \ge 0$. As $\lambda \to 0$, $\Lambda(\lambda) = \lambda\E_\pi\ell + O(\lambda^2)$. As $\lambda \to \infty$, $\Lambda(\lambda)/\lambda \to \max_s\ell_s$. Monotonicity gives the two inequalities. For uniform $\pi$, $\E_\pi e^{\lambda\ell} \ge e^{\lambda\max\ell}/S$, which gives the gap bound. The bound is attained in the limit where every $\ell_s$ except the largest tends to $-\infty$. \hfill$\square$
\paragraph{Lemma~\ref{lem:grad}.} Differentiating $-\frac{1}{\lambda n}\log\sum_s\pi_s e^{\lambda\ell_s}$ with respect to $\theta$ gives
\begin{equation*}
-\frac{1}{\lambda n}\sum_s \frac{\pi_s e^{\lambda\ell_s}}{\sum_{s'}\pi_{s'}e^{\lambda\ell_{s'}}}\,\lambda\nabla_\theta\ell_s . \tag*{$\square$}
\end{equation*}
\paragraph{Lemma~\ref{lem:shift}.} With the stated bank and uniform $\pi$, $\RML_\infty = -\frac1n\max_k \ell_k$, where $\ell_k$ is the window log-likelihood of the label shifted by $k$ samples. This is the hard-min over shifts of the Gaussian negative log-likelihood. The finite-$\lambda$ case is the corresponding soft minimum. \hfill$\square$
\paragraph{Soft-DTW.} The identity behind the statement in Section~\ref{sec:method:rml} is the following.
\begin{lemma}[Soft-DTW]
\label{lem:sdtw}
Let $D_{ij} = -\log\N(y_j; \mu_i, \sigma_i^2)$, let $\mathcal P$ be the set of monotone alignment paths from $(0,0)$ to $(n-1,n-1)$ within a Sakoe--Chiba band, and let $\langle A, D\rangle_w$ be the path cost with symmetric step weights (diagonal steps and the start cell counted twice; \citealp{sakoe1978dp}). For soft-DTW with these steps \citep{cuturi2017softdtw},
\begin{equation}
\frac{\mathrm{sDTW}_\gamma(D)}{2n} = \RML_{\lambda = 2/\gamma}\Big[\text{bank} = \mathcal P,\ \pi \text{ uniform},\ \ell_A = -\tfrac12\langle A, D\rangle_w\Big] - \frac{\gamma}{2n}\log|\mathcal P| .
\end{equation}
\end{lemma}
The last term does not depend on $\theta$. On the diagonal path, $\ell_A$ equals the Gaussian log-likelihood of the window. The unit tests check this identity in its single-path case. Symmetric steps give every path the same total weight $2n$. With standard steps, longer paths visit more cells and, since the negative log-likelihood can be negative, would be preferred. DILATE \citep{leguen2019dilate} adds a temporal-distortion term $\langle A^\star, \Omega\rangle$ with $A^\star = \nabla_D \mathrm{sDTW}_\gamma$ and $\Omega_{ij} = ((i-j)/n)^2$. Its gradient is a Hessian--vector product, which we compute by forward-mode differentiation of the backward pass \citep{mensch2018diffdp}. Our version differs from the original in two ways: the cost is the Gaussian negative log-likelihood, and the steps are symmetric.
\paragraph{Proof of Lemma~\ref{lem:sdtw}.} By definition,
\begin{equation*}
\mathrm{sDTW}_\gamma(D) = -\gamma\log\sum_{A\in\mathcal P}e^{-\langle A,D\rangle_w/\gamma}.
\end{equation*}
Substituting $\ell_A = -\frac12\langle A,D\rangle_w$, $\pi_A = |\mathcal P|^{-1}$ and $\lambda = 2/\gamma$ into \eqref{eq:rml} gives
\begin{equation*}
\RML_{2/\gamma} = -\frac{\gamma}{2n}\log\sum_{A}|\mathcal P|^{-1}e^{-\langle A,D\rangle_w/\gamma} = \frac{\mathrm{sDTW}_\gamma(D)}{2n} + \frac{\gamma}{2n}\log|\mathcal P| .
\end{equation*}
With symmetric steps and the start cell counted twice, every path has total weight $2 + (2n - 2) = 2n$, because the weight of each step equals its increment of $i + j$, which grows from $0$ to $2n - 2$ along the path; and on the diagonal path $\langle A, D\rangle_w = 2\sum_i D_{ii}$, so $\ell_A = \sum_i\log\N(y_i;\mu_i,\sigma_i^2)$. \hfill$\square$