Learn R Programming

fastmatrix (version 0.6)

matrix.sqrt: Matrix square root

Description

This function computes a square root of an \(n\times n\) matrix \(\bold{A}\) by applying the Newton's method.

Usage

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

Arguments

a

a square matrix.

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).

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.

Examples

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

# just checking
root %*% root

Run the code above in your browser using DataLab