power_method: Power Method

Description Usage Arguments Value Examples

Description

Finds a dominant eigenvalue and its corresponding eigenvector of a square matrix by applying the Power Method with scaling

Usage

1
  power_method(X, v = NULL, eps = 1e-06, maxiter = 100)

Arguments

X

a numeric matrix

v

optional starting vector

eps

convergence threshold

maxiter

maximum number of iterations

Value

a list containing the eigenvector, eigenvalue, and iterations

Examples

1
2
3
4
5
A = cbind(c(2, 1), c(-12, -5))
power_method(A, v = rep(1, nrow(A)))

B = cbind(c(1, -2, 1), c(2, 1, 3), c(0, 2, 1))
power_method(B)

gastonstat/matrixkit documentation built on May 16, 2019, 5:45 p.m.