importance_rank {SWIM} | R Documentation |
Importance Ranking for a Stressed Model
Description
Provides the importance ranks of the components (random variables) of a stressed model for different sensitivity measures.
Usage
importance_rank(
object,
xCol = "all",
wCol = "all",
type = c("Gamma", "Wasserstein", "reverse", "all"),
f = NULL,
k = NULL,
s = NULL
)
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 |
type |
Character, one of |
f |
A function, or list of functions, that, applied to
|
k |
A vector or list of vectors, same length as |
s |
A function that, applied to |
Details
For the definition of the sensitivity
measures (type
), see sensitivity
.
Value
A data.frame containing the importance ranks of the
stressed model for different sensitivity measures. Small values
correspond to large sensitivities. Different rows correspond
to different random variables. The first two rows specify the
stress
and type
of the sensitivity measure on
which the ranking is calculated.
Author(s)
Silvana M. Pesenti
See Also
See sensitivity
for the values of the
sensitivity measures, plot_sensitivity
for plotting
sensitivity measures and summary
for a
summary statistic of a stressed model.
Examples
## example with a stress on VaR
set.seed(0)
x <- as.data.frame(cbind(
"log-normal" = rlnorm(1000),
"gamma" = rgamma(1000, shape = 2)))
res1 <- stress(type = "VaR", x = x,
alpha = c(0.9, 0.95), q_ratio = 1.05)
importance_rank(res1, wCol = 1:2, type = "Gamma")
## sensitivity of log-transformed data
importance_rank(res1, wCol = 1, type = "all",
f = list(function(x)log(x), function(x)log(x)), k = list(1, 2))