mean_stressed: Mean of a Stressed Model

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

View source: R/mean.R

Description

Provides the mean of stressed model components (random variables) under the scenario weights.

Usage

1
mean_stressed(object, xCol = "all", wCol = "all", base = FALSE)

Arguments

object

A SWIM or SWIMw object.

xCol

Numeric or character vector, (names of) the columns of the underlying data of the object (default = "all").

wCol

Vector, the columns of the scenario weights of the object corresponding to different stresses (default = "all").

base

Logical, if TRUE, statistics under the baseline are also returned (default = "FALSE").

Details

mean_stressed: Sample mean of chosen stressed model components, subject to the calculated scenario weights.

Value

A matrix containing the means of the xCol components of the stressed model with weights wCol.

Author(s)

Kent Wu

See Also

See var_stressed and sd_stressed compute stressed variance and standard deviations under the scenario weights, respectively.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
     
## example with a stress on VaR
set.seed(0)
x <- as.data.frame(cbind(
  "normal" = rnorm(1000), 
  "gamma" = rgamma(1000, shape = 2)))
res1 <- stress(type = "VaR", x = x, 
  alpha = c(0.9, 0.95), q_ratio = 1.05)
## stressed mean
mean_stressed(res1, xCol = "all", wCol = "all", base = TRUE)

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