This function generates a large dimensional panic copula that can be further used for stress-testing and panic-aware portfolio optimization.

panic_copula(
  x,
  n = 10000,
  panic_cor = 0.99,
  panic_prob = 0.02,
  dist = c("normal", "t")
)

Arguments

x

A rectangular (non-tidy) data structure.

n

An integer with the number of scenarios to be generated.

panic_cor

A numeric value for the correlation in panic markets.

panic_prob

A numeric value with the probability in which panic markets can be triggered.

dist

A character with normal or t. The default is normal

Value

An object of the panic class.

Examples

x <- diff(log(EuStockMarkets))
panic_copula(x = x, n = 20, panic_cor = 0.99, panic_prob = 0.02)
#> # Panic Copula
#> simulation: << tbl 20 x 4 >>
#> p:          << dbl 20 x 1 >>