Squared Mahalanobis distance
Source:R/03_03_DeCovarT_estimate_ratios_frequentist.R
dot-squared_mahalanobis_distance.RdComputes \((\boldsymbol{x}-\boldsymbol{m})^{\mathsf{T}} \boldsymbol{\Sigma}^{-1}(\boldsymbol{x}-\boldsymbol{m})\) for a symmetric positive-definite covariance (or scatter) matrix \(\boldsymbol{\Sigma}\). This is the squared distance; take the square root for the Mahalanobis distance itself. Solves \(\boldsymbol{\Sigma}\boldsymbol{z}=\boldsymbol{\delta}\) instead of forming \(\boldsymbol{\Sigma}^{-1}\) explicitly.