Learn R Programming

FRAPO (version 0.4-2)

sqrm: Square root of a quadratic matrix

Description

This function returns the square root of a quadratic and diagonalisable matrix.

Usage

sqrm(x, ...)

Value

A matrix object and a scalar in case a \((1 \times 1)\) matrix has been provided.

Arguments

x

matrix, must be quadratic.

...

The ellipsis argument is passed down to eigen().

Author

Bernhard Pfaff

Details

The computation of the square root of a matrix is based upon its eigen values and corresponding eigen vectors. The square matrix \(A\) is diagonisable if there is a matrix \(V\) such that \(D = V^{-1}AV\), whereby \(D\) is a diagonal matrix. This is only achieved if the eigen vectors of the \((n \times n)\) matrix \(A\) constitute a basis of dimension \(n\). The square root of \(A\) is then \(A^{1/2} = V D^{1/2} V'\).

See Also

Examples

Run this code
data(StockIndex)
S <- cov(StockIndex)
SR <- sqrm(S)
all.equal(crossprod(SR), S)

Run the code above in your browser using DataLab