stress_RM_w: Stressing Risk Measure

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

View source: R/stress_RM.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 risk measure defined by a gamma function. The default risk measure is the Expected Shortfall at level alpha.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
stress_RM_w(
  x,
  alpha = 0.8,
  q_ratio = NULL,
  q = NULL,
  k = 1,
  h = 1,
  gamma = NULL,
  names = NULL,
  log = FALSE,
  method = "Nelder-Mead"
)

Arguments

x

A vector, matrix or data frame containing realisations of random variables. Columns of x correspond to random variables; OR
A SWIMw object, where x corresponds to the underlying data of the SWIMw object. The stressed random component is assumed continuously distributed.

alpha

Numeric, vector, the level of the Expected Shortfall. (default Expected Shortfall)

q_ratio

Numeric, vector, the ratio of the stressed RM to the baseline RM (must be of the same length as alpha or gamma).

q

Numeric, vector, the stressed RM at level alpha (must be of the same length as alpha or gamma).

k

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

h

Numeric, a multiplier of the default bandwidth using Silverman’s rule (default h = 1).

gamma

Function of one variable, that defined the gamma of the risk measure. (default Expected Shortfall).

names

Character vector, the names of stressed models.

log

Boolean, the option to print weights' statistics.

method

The method to be used in [stats::optim()]. (default = Nelder-Mead).

Details

This function implements stresses on distortion risk measures. Distortion risk measures are defined by a square-integrable function gamma where

\int_0^1 gamma(u) du = 1.

The distortion risk measure for some gamma and distribution G is calculated as:

ρ_{gamma}(G) = \int_0^1 \breve(G)(u) gamma(u) du.

Expected Shortfall (ES) is an example of a distortion risk measure. The ES at level alpha of a random variable with distribution function F is defined by:

ES_{alpha} = 1 / (1 - alpha) * \int_{alpha}^1 VaR_u d u.

Value

A SWIMw object containing:

See SWIM for details.

Author(s)

Zhuomin Mao

References

\insertRef

Pesenti2019reverseSWIM

\insertRef

Pesenti2020SSRNSWIM

\insertRef

Pesenti2021SSRNSWIM

See Also

Other stress functions: stress_HARA_RM_w(), stress_RM_mean_sd_w(), stress_VaR_ES(), stress_VaR(), 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
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
set.seed(0)
x <- as.data.frame(cbind(
  "normal" = rnorm(1000),
  "gamma" = rgamma(1000, shape = 2)))
res1 <- stress_wass(type = "RM", x = x,
  alpha = 0.9, q_ratio = 1.05)
  summary(res1)

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

# dual power distortion with beta = 3
# gamma = beta * u^{beta - 1}, beta > 0 

gamma <- function(u){
  .res <- 3 * u^2
  return(.res)
}
res3 <- stress_wass(type = "RM", x = x, 
  gamma = gamma, q_ratio = 1.05)
summary(res3)

## End(Not run)
 

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