communicability_matrix: Computes the communicability matrix

Description Usage Arguments Value References Examples

View source: R/communicability_measures.R

Description

The communicability of an adjacency matrix M is defined as exp(M) where M[i,j] can be interpreted as the weighted sums of paths from i to j. Recall that exp(M) can be cast into a Taylor series expansion with an infinite number additive terms. The function permits the evaluation of exp(M) using the expm package or using a simpler mathematical approximation. In the second case, the function truncates the infinite series by simply calculating the summation terms up to a pre-defined number of factors.

Usage

1

Arguments

x

a square matrix or an igraph object.

terms

truncates the communicability matrix evaluation up to a pre-defined number of terms. If terms = Inf the function computes the matrix exponential using expm.

sparse

should the function use sparse matrices when computing the communicability? However, if terms = Inf the function will use expm which uses dgeMatrix-class.

Value

The function returns the communicability matrix.

References

Estrada, E. Hatano, N. (2008). Communicability in complex networks. Physical Review E, 77:036111.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Creating example data
## Assets Matrix (bilateral exposures)
assets_matrix <- matrix(c(0, 10, 3, 1, 0, 2, 0, 3, 0), ncol = 3)
rownames(assets_matrix) <- colnames(assets_matrix) <- letters[1:3]

## Capital Buffer
buffer <- c(a = 2, b = 5, c = 2)

# Computing vulnerability
v <- vulnerability_matrix(assets_matrix, buffer, binary = TRUE)

# Computing communicability of the vulnerability matrix
communicability_matrix(v)

NetworkRiskMeasures documentation built on March 13, 2020, 3:24 a.m.