stress_VaR: Stressing Value-at-Risk

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/stress_VaR.R

Description

Provides weights on simulated scenarios from a baseline stochastic model, such that a stressed model component (random variable) fulfils a constraint on its quantile at a given level, also known as Value-at-Risk (VaR). Scenario weights are selected by constrained minimisation of the relative entropy to the baseline model.

Usage

1
2
3
4
5
6
7
8
9
stress_VaR(
  x,
  alpha,
  q_ratio = NULL,
  q = NULL,
  k = 1,
  names = NULL,
  log = FALSE
)

Arguments

x

A vector, matrix or data frame containing realisations of random variables. Columns of x correspond to random variables; OR
A SWIM object, where x corresponds to the underlying data of the SWIM object.

alpha

Numeric vector, the levels of the stressed VaR.

q_ratio

Numeric vector, the ratio of the stressed VaR to the baseline VaR.
If alpha and q_ratio are vectors, they must have the same length.

q

Numeric vector, the stressed VaR at level alpha.
If alpha and q are vectors, they must have the same length.

k

Numeric, the column of x that is stressed (default = 1).

names

Character vector, the names of stressed models.

log

Boolean, the option to print weights' statistics.

Details

The stressed VaR is the quantile of the chosen model component, subject to the calculated scenario weights. The VaR at level alpha of a random variable with distribution function F is defined as its left-quantile at alpha:

VaR_{alpha} = F^{-1}(alpha).

If one of alpha, q (q_ratio) is a vector, the stressed VaR's of the kth column of x, at levels alpha, are equal to q.

The stressed VaR specified, either via q or q_ratio, might not equal the attained empirical VaR of the model component. In this case, stress_VaR will display a message and the specs contain the achieved VaR.

Value

A SWIM object containing:

See SWIM for details.

Author(s)

Silvana M. Pesenti

References

\insertRef

Pesenti2019reverseSWIM

\insertRef

Pesenti2020SSRNSWIM

\insertRef

Csiszar1975SWIM

See Also

Other stress functions: stress_HARA_RM_w(), stress_RM_mean_sd_w(), stress_RM_w(), stress_VaR_ES(), stress_mean_sd_w(), stress_mean_sd(), stress_mean_w(), stress_mean(), stress_moment(), stress_prob(), stress_user(), stress_wass(), stress()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(0)
x <- as.data.frame(cbind(
  "normal" = rnorm(1000),
  "gamma" = rgamma(1000, shape = 2)))
res1 <- stress(type = "VaR", x = x,
  alpha = 0.9, q_ratio = 1.05)

## calling stress_VaR directly
## stressing "gamma"
res2 <- stress_VaR(x = x, alpha = 0.9,
  q_ratio = c(1.03, 1.05), k = 2)
get_specs(res2)
summary(res2)

spesenti/SWIM documentation built on Jan. 15, 2022, 11:19 a.m.