For calculation of sigma points in Unscented Kalman filter(UKF), we need to take the square root of the covariance matrix. There are two ways to calculate the square root of a matrix:
1. Using cholesky decomposition - works only for positive definite matrix and the result is an upper or lower triangular matrix.
2. Using sqrtm - works for positive semidefinite as well. The result is a dense matrix.
I have observed that for Positive definite matrices, the eigen values of the matrix obtained by cholesky decomposition and by using sqrtm are same. It means that the matrices obtained by the two method is identical for positive definite covariance matrix.
I want to ask :
1. can we use "sqrtm", in general, for finding the square root of a matrix??
2. People using UKF, in general, use "chol" to find the square root. What could be the reason?? What could be the reason?? I mean why not use "sqrtm" as it provides the square root even if the matrix is not positive definite.
Thanks.