Covariance-consistent rescaling of whitened spectral coordinates (source code)

= Covariance-consistent rescaling of whitened spectral coordinates
{title2=$C'=DCD^T$}

\b[<Covariance>-consistent rescaling of whitened spectral coordinates] changes measurement units or mixes coordinates while transforming their noise model at the same time. If an invertible matrix $D$ maps a spectral vector to $\mathbf y'=D\mathbf y$, then
$$
\mathbf s'=D\mathbf s,\quad\mathbf x'=D\mathbf x,\quad C'=DCD^T.
$$
The <covariance> follows directly from the expectation of the transformed error outer product. For positive-definite $C$,
$$
(C')^{-1}=D^{-T}C^{-1}D^{-1},\qquad
(\mathbf s')^T(C')^{-1}\mathbf x'=\mathbf s^TC^{-1}\mathbf x.
$$
Thus the inverse-<covariance> inner product, its norms and the resulting whitened angle are invariant. <Invariance of noise-whitened spectral angles to the whitening factor> establishes the related freedom to rotate the fully whitened coordinates.

For an original example, let $C=\operatorname{diag}(1,9)$, $\mathbf s=(1,1)^T$ and $\mathbf x=(1,-1)^T$. Their noise-whitened angle has cosine $0.8$, or angle about $36.87^{\circ}$. Converting only the first raw coordinate's numerical units by a factor of 1000 gives $D=\operatorname{diag}(1000,1)$ and $C'=\operatorname{diag}(10^6,9)$. Using that transformed <covariance> keeps the cosine exactly $0.8$.

If the shapes are rescaled but the old <covariance> is mistakenly retained, the calculated cosine becomes approximately $0.99999978$, suggesting an angle only about $0.0382^{\circ}$. A unit conversion would then appear to destroy the separation between signal and nuisance. That apparent change comes from inconsistent uncertainty accounting.

For any full whitening factor $W$, the transformed factor $W'=WD^{-1}$ satisfies $W'C'(W')^T=I$ and gives $W'\mathbf s'=W\mathbf s$. The pinned SciPy documentation describes whitening and demonstrates a near-identity <covariance> after transformation.<SciPy 1.16.2 documentation>[scipy.stats.Covariance.whiten, Description and Examples]{ref} Measurement propagation likewise retains all <covariance> terms under a linear transformation.<Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results by Barry N. Taylor and Chris E. Kuyatt>[Appendix A, equation A-3]{ref}

The invertibility condition matters. <Noninvertible spectral compression versus a coordinate change> can discard information and need not preserve these angles. A transformation estimated from the same noisy observations also brings estimation uncertainty beyond the fixed-matrix identity proved here.