While trying to apply the algorithm described in the article:
Robust adaptative metropolis algorithm with coerced acceptance rate (2011), Matti Vihola
I used the a Cholesky decomposition to find $S_n$:
$S_n S_n^T = S_{n-1} D_n S_{n-1}^T$
The article ensures that the (known) matrix in the right hand side will always be positive definite. However, after a lot of iterations, it seems that floating point imprecision is causing it to be only positive semi-definite. I would like to know if it is possible (and how?) to get $S_n$ using a robust Cholesky decomposition of a matrix with pivoting which works when standard Cholesky fails.
The problem is when using it, the result is obviously not the $S_n$ matrix, but rather an $X_n$ of the form:
$P^T X_n Y X_n^T P = S_{n-1} D_n S_{n-1}^T$
From what @J.M. has said here, it seems possible:
The Cholesky decomposition might fail in floating point when given a symmetric positive semidefinite matrix. However, one can modify Cholesky to do symmetric pivoting so that the matrix is factored for "as long as the matrix seems positive definite". You'll have to modify your Kalman formula if you adopt this, though.
So, it seems that I need to do some algebra here to get $S_n$, I just don't know how since I'm pretty n00b in such subject.