I have a large, sparse matrix $M\in\mathbb{R}^{n\times p}$. Centering $M$ to compute the covariance matrix $\Sigma$ would, in general, destroy the "zeros aren't stored" property of sparse matrices. Instead, we can center $\Sigma$ after computing the second moment. There are any number of ways to do this, but I want one that is cheap and numerically stable.
The goal of estimating $\Sigma$ is to compute many evaluations of $f(x) = x^\top \Sigma^{-1} x$.
My first thought was to compute $M^\top M$ and apply the Bunch-Nielsen-Sorensen formula for a rank-1 update to a spectral decomposition, which allows one to compute the eigenvalues and eigenvectors to $A$ for $D$ diagonal and $\rho\in\mathbb{R}$ $$ A = D + \rho zz^\top $$ (Some algebra extends this to updating $\Sigma$.) However, BNS requires that $z_i>0 ~\forall ~ i$, and that does not hold for the mean vector $\mu$ in general.
As a work-around, I could apply two successive BNS updates, one for a $\tilde{\mu}$ which shifts the nonpositive elements of $\mu$ to be positive, and a second which offsets that shift. This is (probably) more efficient than two spectral decompositions.
Another way would form a pseudoinverse and apply the Sherman-Morrison formula, but we all know that one should never explicitly compute a matrix inverse, hence my interest in factorizations.