matpower: compute the power of a matrix

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/matpower.R

Description

the power of a matrix

Usage

1
matpower(x, n, nf = min(dim(x)), tol = 1e-07)

Arguments

x

a numerical matrix object that the power of which should be calculated

n

The matrix to the power of

nf

The number of axes kept in the calculation of SVD and reconstruction

tol

The tolerance of the axis, singular vectors with singular value lower than tol will be ignored in the reconstruction.

Details

The power of a matrix is calculated in two steps: decompostion step: x=UDV' and the reconstruction step: x^n=U*D^n*V' In the reconstruction, the singular vectors with a singular value more than tol are kept.

Value

A matrix x^n

Note

Called by the wsvd function.

Author(s)

Chen Meng

See Also

See Also wsvd

Examples

1
2
3
4
  set.seed(56)
  m <- matrix(rnorm(15), 5, 3)
  s <- matpower(m, 2)
  s <- matpower(m, -2)

mengchen18/mogsa documentation built on June 7, 2020, 6:05 p.m.