Cholesky decomposition works only for a positive definite matrix. If a matrix is not positive
definite, Wang (2006) suggests to first do an eigen decomposition. Second, force the non-negative
diagonal elements in the diagonal matrix to be a small non-negative number, e.g., 0. Third,
re-construct a positive definite matrix from the new diagonal elements. Finally, Cholesky
decomposition can proceed as usual to the "modified" matrix.