cdf_stressed {SWIM} | R Documentation |
Empirical Distribution Function of a Stressed Model
Description
Provides the empirical distribution of a stressed model component (random variable) under the scenario weights
Usage
cdf_stressed(object, xCol = 1, wCol = "all", grid, base = FALSE)
Arguments
object |
A |
xCol |
Numeric, (name of) the column of the underlying data
of the |
wCol |
Vector or characters, the columns of the scenario weights
of the |
grid |
Vector, the empirical distribution of the |
base |
Logical, if TRUE, statistics under the baseline are also returned (default = "FALSE").] |
Details
The cdf_stressed
returns the values of the empirical distribution function
of the xCol
model components for weights wCol
. In contrast, the cdf
function
returns a function, analogous to the ecdf
from the base package. The
function cdf_stressed
is the cdf
function applied to grid.
Value
A matrix containing the empirical distribution function
applied to grid
of the xCol
components of the
stressed model with weights wCol
.
Author(s)
Kent Wu
See Also
See cdf
for the empirical distribution function of a stressed
model component and quantile_stressed
for sample quantiles of
a stressed model.
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)
grid <- seq(min(x$normal), max(x$normal), length.out = 5)
## stressed empirical distribution function
cdf_stressed(res1, xCol = 1, wCol = "all", grid = grid)