cor_stressed {SWIM} | R Documentation |
Correlation of a Stressed Model
Description
Provides the correlation of stressed model components (random variable) under the scenario weights.
Usage
cor_stressed(
object,
xCol = c(1, 2),
wCol = "all",
method = "Pearson",
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 |
method |
Character, one of |
base |
Logical, if |
Details
cor_stressed
: The correlation coefficient of
stressed model components, subject to the calculated scenario weights.
Value
cor_stressed
returns a list of correlation matrices
corresponding to different stresses. Entries of the matrices denote
correlation coefficients between stressed model components specified by xCol
.
Author(s)
Kent Wu
See Also
See var_stressed
and sd_stressed
compute
stressed variance and standard deviations under the scenario weights, respectively.
See cor
for unweighted correlations between model components, while
cor_stressed
return 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 correlation
cor_stressed(res1, xCol = c(1, 2), wCol = 1, base=TRUE)