criticality: Criticality of the vertices

Description Usage Arguments Value Examples

View source: R/communicability_measures.R

Description

The criticality of a vertex measures its impact on its neighbors if it defaults. It is basically the rowSums of the impact_matrix.

Usage

1
2
3
4
5
6
criticality(
  exposures,
  buffer,
  binary = FALSE,
  exposure_type = c("assets", "liabilities", "impact", "vulnerability")
)

Arguments

exposures

an adjacency matrix, (sparse) Matrix or an igraph object with the network of bilateral exposures between vertices. By default, the function expects the exposures in the form of an assets matrix in which A -> B means that A has an asset with B. However, you can change that with the parameter exposure_type. When using a matrix, preferably it should have rows and columns names.

buffer

a numeric vector with the capital buffer for each vertex. Values should be in the same row/column order as the network of bilateral exposures. The buffer is not needed if exposure_type = "vulnerability".

binary

if binary = TRUE the function computes a 'binary' impact or vulnerability matrix. It truncates all values less than 1 to 0 and all values greater than 1 to 1.

exposure_type

character vector indicating the type of the bilateral exposures. It can be an "assets" network (where A -> B means that A has an asset with B), a "liabilities" network (where A -> B means that A has a debt with B), a (binary) "impact" matrix (where A -> B indicates the relative impact of A in B's capital buffer), or a (binary) "vulnerability" matrix (where A -> B indicates the relative impact A suffers from B's default). The default is "assets".

Value

The function returns a (named) vector with the criticality for each vertex.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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)

# Criticality
criticality(assets_matrix, buffer)

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