power_function: Power matrix

View source: R/utilities.R

power_functionR Documentation

Power matrix

Description

Power of a matrix computed by successive matrix multiplication.

Usage

power_function(A, n)

Arguments

A

A matrix

n

Positive integer

Value

This function return the power of a matrix by repeating matrix multiplication.

Author(s)

Alejandro Espinosa-Rada

References

Wasserman, S. and Faust, K. (1994). Social network analysis: Methods and applications. Cambridge University Press.

Examples

A <- matrix(c(
  1, 0, 0, 0,
  1, 1, 0, 0,
  1, 0, 1, 0,
  0, 1, 1, 1
), byrow = TRUE, ncol = 4, nrow = 4)
power_function(A, 1000)


anespinosa/netmem documentation built on April 5, 2025, 5:02 p.m.