sqrm function

Square root of a quadratic matrix

Square root of a quadratic matrix

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

sqrm(x, ...)

Arguments

  • x: matrix, must be quadratic.
  • ...: The ellipsis argument is passed down to eigen().

Details

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

Returns

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

Author(s)

Bernhard Pfaff

See Also

eigen

Examples

data(StockIndex) S <- cov(StockIndex) SR <- sqrm(S) all.equal(crossprod(SR), S)
  • Maintainer: Bernhard Pfaff
  • License: GPL (>= 3)
  • Last published: 2016-12-12

Useful links