sim_data: Simulated Interbank Data

Description Format Examples

Description

A simulated dataset with interbank assets, liabilities, capital buffer and weights for 125 "banks". The code to generate the data is on the examples.

Format

A data frame with 125 rows and 5 variables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Simulated data for ilustration purposes

# Setting Seed
set.seed(1100)

# Heavy tailed assets
assets <- rlnorm(125, 0, 2)
assets[assets < 4] <- runif(length(assets[assets < 4]))

# Heavy tailed liabilities
liabilities <- rlnorm(125, 0, 2) 
liabilities[liabilities < 4] <- runif(length(liabilities[liabilities < 4]))

# Making sure assets = liabilities
assets <- sum(liabilities) * (assets/sum(assets))

# Buffer as a function of assets
buffer <- pmax(0.01, runif(length(liabilities))*liabilities + abs(rnorm(125, 4, 2.6)))

# Weights as a function of assets, buffer and liabilities
weights <- (assets + liabilities + buffer + 1) + rlnorm(125, 0, 1)

# creating data.frame
sim_data <- data.frame(bank  = paste0("b", 1:125),
                       assets = assets,
                       liabilities = liabilities,
                       buffer = buffer,
                       weights = weights)
 

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