mdPartialMD computes squared Mahalanobis distances using only observed entries.
The function computes for each row i the (squared) Mahalanobis distance:
d2(i) = (x_obs - mu_obs)' * inv(Sigma_obs_obs) * (x_obs - mu_obs) where obs are the indices of non-missing entries in row i.
Little, R. J. A., & Rubin, D. B. (2019). Statistical Analysis with Missing Data (3rd ed.). Hoboken, NJ: John Wiley & Sons.
Templ, M. (2023). Visualization and Imputation of Missing Values: With Applications in R. Cham, Switzerland: Springer Nature.