matrixpower {spatstat.sparse}R Documentation

Power of a Matrix

Description

Evaluate a specified power of a matrix.

Usage

  matrixpower(x, power, complexOK = TRUE)
  matrixsqrt(x, complexOK = TRUE)
  matrixinvsqrt(x, complexOK = TRUE)

Arguments

x

A square matrix containing numeric or complex values.

power

A numeric value giving the power (exponent) to which x should be raised.

complexOK

Logical value indicating whether the result is allowed to be complex.

Details

These functions raise the matrix x to the desired power: matrixsqrt takes the square root, matrixinvsqrt takes the inverse square root, and matrixpower takes the specified power of x.

Up to numerical error, matrixpower(x, 2) should be equivalent to x %*% x, and matrixpower(x, -1) should be equivalent to solve(x), the inverse of x.

The square root y <- matrixsqrt(x) should satisfy y %*% y = x. The inverse square root z <- matrixinvsqrt(x) should satisfy z %*% z = solve(x).

Computations are performed using the eigen decomposition (eigen).

Value

A matrix of the same size as x containing numeric or complex values.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

See Also

eigen, svd

Examples

  x <- matrix(c(10,2,2,1), 2, 2)
  y <- matrixsqrt(x)
  y
  y %*% y 
  z <- matrixinvsqrt(x)
  z %*% y
  matrixpower(x, 0.1)

[Package spatstat.sparse version 3.1-0 Index]