Returns the principal square root of a symmetric positive semi-definite block diagonal matrix.
Each block is symmetrised and decomposed with a symmetric eigensolver. Eigenvalues that are negative only at rounding level, as the zero eigenvalues of a rank-deficient block are (for example the negative Hessian of a likelihood with more latent variables than observations), are clamped to zero. An eigenvalue below -block_size * epsilon * max(|eigenvalues|) means the block is not positive semi-definite.
- Template Parameters
-
| WRootMat | A type inheriting from Eigen::EigenBase. |
- Parameters
-
| W_root | The output matrix to store the square root. |
| W | The input block diagonal matrix. |
| block_size | The size of each block in the block diagonal matrix. |
- Exceptions
-
| std::domain_error | if a block has non-finite entries or is not positive semi-definite. |
Definition at line 242 of file laplace_marginal_density_estimator.hpp.