Learn R Programming

fastmatrix (version 0.6-2)

matrix.sqrt: Matrix square root

Description

This function computes a square root of an \(n\times n\) matrix \(\bold{A}\).

Usage

matrix.sqrt(a, method = "DB", maxiter = 50, tol = 1e-8)

Arguments

a

a square matrix.

method

the procedure used to obtain the square root. If method = "DB" (the default) the matrix square root is obtained using a Newton's method. If method = "schur" the Schur decomposition is considered.

maxiter

the maximum number of iterations. Defaults to 50

tol

a numeric tolerance.

Details

A square root of a square matrix \(\bold{A}\) is obtained by solving the equation \(\bold{X}^2 = \bold{A}\), considering the Newton iteration proposed by Denman and Beavers (1976), or alternatively is based on the Schur decomposition.

References

Denman, E.D., Beavers, A.N. (1976). The matrix sign function and computations in systems. Applied Mathematics and Computation 2, 63-94.

Higham, N.J. (1986). Newton's method for the matrix square root. Mathematics of Computation 46, 537-549.

Higham, N.J. (1986). Functions of Matrices: Theory and Computation. Society for Industrial and Applied Mathematics, Philadelphia.

Examples

Run this code
a <- matrix(c(35,17,3,17,46,11,3,11,12), ncol = 3)
root <- matrix.sqrt(a) # 8 iterations

# just checking
root %*% root

root <- matrix.sqrt(a, method = "schur")

Run the code above in your browser using DataLab