Range restriction in singular-covariance spectral fitting (source code)

= Range restriction in singular-covariance spectral fitting
{title2=$(I-CC^+)(\mathbf y-\mathbf m)=0$}

\b[Range restriction in singular-<covariance> spectral fitting] requires a residual to lie in the subspace where the measurement model allows random error. Let $\mathbf y=\mathbf m(\theta)+\boldsymbol\epsilon$ with zero-mean error <covariance> $C$. Every vector $\mathbf v$ in the kernel of $C$ satisfies
$$
\mathbb E[(\mathbf v^T\boldsymbol\epsilon)^2]=\mathbf v^TC\mathbf v=0,
$$
so $\mathbf v^T\boldsymbol\epsilon=0$ almost surely. Thus a permissible residual obeys
$$
(I-CC^+)\bigl(\mathbf y-\mathbf m(\theta)\bigr)=0,
$$
where $C^+$ is the <Moore-Penrose inverse>. The matrix $CC^+$ is the <orthogonal projector> onto the range of the <covariance>.

Only after enforcing this condition should a <generalized least squares> objective use $(\mathbf y-\mathbf m)^TC^+(\mathbf y-\mathbf m)$. The quadratic form alone assigns zero penalty to the forbidden directions and therefore cannot impose the condition. <Rank deficiency from deterministic spectral upsampling> gives its physical spectral-grid origin through $C=AC_{\rm in}A^T$. <Covariance> propagation preserves those exact dependencies.<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}

For an original idealized two-channel example, take $C=\operatorname{diag}(1,0)$, mean $\mathbf m(\theta)=(\theta,2\theta)^T$ and observation $(3,4)^T$. The second channel has no random error in this stipulated model, so the range condition forces $\theta=2$. The remaining squared residual is one. Minimizing only the pseudoinverse quadratic would instead choose $\theta=3$ and objective zero, while predicting the impossible second-channel value six.

Real measurements need not contain a perfect channel: deterministic rebinning produces exact noise-free combinations of otherwise noisy channels. Additional physical noise in such a combination must be modelled if present. If <covariance> ranges change with the parameters, <pseudoinverse fitting with a parameter-dependent covariance range> requires enforcing the appropriate support for each candidate; a single fixed projection need not apply.

Raman detector-array spectra are recorded before numerical redistribution onto another spectral grid.<Femtosecond Broadband Stimulated Raman: A New Approach for High-Performance Vibrational Spectroscopy by David W. McCamant and others>[Instrumentation, array detection; Data Collection, equation 4]{ref} Fitting the original independent measurement coordinates often makes these support restrictions explicit and avoids treating interpolation points as new observations.