[Insight-users] how to calculate the sqrt of a matrix

Luis Ibanez luis.ibanez at kitware.com
Wed Apr 11 13:14:41 EDT 2007



Hi Achille,


Here are some options:


http://en.wikipedia.org/wiki/Matrix_square_root


1) If your matrix is diagonalizable

      the you could get its eigenvalues
      and eigenvectors.

      Then reconstruct the square root
      matrix by using the square root
      values of the eigen-values

http://en.wikipedia.org/wiki/Matrix_square_root#Diagonalizable_matrices

    you can perform eigen analysis
    using the classes:

Insight/Utilities/vxl/core/vnl/algo/
vnl_svd.h
vnl_svd.txx

    or  with


Insight/Code/Common/
itkSymmetricEigenAnalysis.h



2) If your matrix is symmetric, you
    could use the Cholesky decomponsition
    and get a tri-diagonal matrix as the
    square root.

http://en.wikipedia.org/wiki/Cholesky_factorization

Insight/Utilities/vxl/core/vnl/algo/
vnl_cholesky.cxx
vnl_cholesky.h
vnl_ldl_cholesky.cxx
vnl_ldl_cholesky.h



Otherwise:


3) You could use the iterative numerical  method:

http://en.wikipedia.org/wiki/Matrix_square_root#Numerical_method

    That just requires successive computations
    of averages with the inverse. For this
    you simply can use the vnl inverse and the
    vnl_matrix product.







     Regards,



        Luis



----------------------------
achille mangna wrote:
> 
> thanks Luis.
> my sqrt is in matrix sense .
> M = Q * Q.
> i'm implementing the ICA algorithme and i need to calculate  something like
>                    wz=2*inv(sqrtm(c)).
> where wz and c are matrix.
>  i found how to calculate the inverse matrix (vnl_matrix_inverse )
> but not the square.
> 


More information about the Insight-users mailing list