stress: Stressing Random Variables

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

View source: R/stress.R

Description

Provides weights on simulated scenarios from a baseline stochastic model, such that stressed random variables fulfil given probabilistic constraints (e.g. specified values for risk measures), under the new scenario weights. Scenario weights are selected by constrained minimisation of the relative entropy to the baseline model.

Usage

1
2
3
4
5
stress(
  type = c("VaR", "VaR ES", "mean", "mean sd", "moment", "prob", "user"),
  x,
  ...
)

Arguments

type

Type of stress, one of "VaR", "VaR ES", "mean", "mean sd", "moment", "prob", "user".

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.

...

Arguments to be passed on, depending on type.

Value

An object of class SWIM, 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_VaR(), stress_mean_sd_w(), stress_mean_sd(), stress_mean_w(), stress_mean(), stress_moment(), stress_prob(), stress_user(), stress_wass()

Examples

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

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