sd_stressed {SWIM} | R Documentation |
Standard Deviation and Variance of a Stressed Model
Description
Provides the standard deviation and variance of stressed model components (random variables) under the scenario weights.
Usage
sd_stressed(object, xCol = "all", wCol = "all", base = FALSE)
var_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
sd_stressed
: The standard deviation of
a chosen model component, subject to the calculated scenario weights.
var_stressed
: The variance of
a chosen stressed model component, subject to the calculated scenario weights.
Value
sd_stressed
: Return the standard deviation of the xCol
component of the stressed model with weights wCol
.
The quantity can be evaluated at a vector.
var_stressed
: Return the variance of the xCol
component of the stressed model with weights wCol
.
The quantity can be evaluated at a vector.
Functions
-
sd_stressed
: Sample standard deviation of model components -
var_stressed
: Sample variance of model components
Author(s)
Kent Wu
See Also
See mean_stressed
for means of stressed model components,
and cor_stressed
for correlations between stressed model components.
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 standard deviation
sd_stressed(res1, xCol = "all", wCol = "all", base = TRUE)
## stressed variance
var_stressed(res1, xCol = "all", wCol = "all", base = TRUE)