mean_stressed {SWIM} | R Documentation |
Mean of a Stressed Model
Description
Provides the mean of stressed model components (random variables) under the scenario weights.
Usage
mean_stressed(object, xCol = "all", wCol = "all", base = FALSE)
Arguments
object |
A |
xCol |
Numeric or character vector, (names of) the columns of
the underlying data
of the |
wCol |
Vector, the columns of the scenario weights
of the |
base |
Logical, if |
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
## 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)