sqrtmatrix: Square root of a symmetric, positive semi-definite matrix

Description Usage Arguments Details Value Author(s) Examples

Description

Calculation of the square root of a positive semi-definite matrix (see Details for the definition of such a matrix).

Usage

1

Arguments

mat

numeric matrix.

Details

The matrix mat must be symmetric and positive semi-definite. Otherwise, there is an error.

The square root of the matrix mat is the positive semi-definite matrix M such as t(M) %*% M = mat. Do not confuse with sqrt(mat), which returns the square root of the elements of mat.

The computation is based on the diagonalisation of mat. The eigenvalues smaller than 10^-16 are identified as null values.

Value

Matrix: the square root of the matrix mat.

Author(s)

Rachid Boumaza, Pierre Santagostini, Smail Yousfi, Gilles Hunault, Sabine Demotes-Mainard

Examples

1
2
3
    M2 <- matrix(c(5, 4, 4, 5), nrow = 2)
    M <- sqrtmatrix(M2)
    M


Search within the dad package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.