Description Usage Arguments Value References Examples
View source: R/communicability_measures.R
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.
1 | communicability_matrix(x, terms = Inf, sparse = TRUE)
|
x |
a square |
terms |
truncates the communicability matrix evaluation up to a pre-defined number of terms.
If |
sparse |
should the function use sparse matrices when computing the communicability?
However, if |
The function returns the communicability matrix.
Estrada, E. Hatano, N. (2008). Communicability in complex networks. Physical Review E, 77:036111.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.