cdf {SWIM} | R Documentation |
Distribution Function of a Stressed Model
Description
Provides the empirical distribution function of a stressed SWIM model component (random variable) or KDE distribution of a stressed SWIMw model component under the scenario weights.
Usage
cdf(object, xCol = 1, wCol = 1)
Arguments
object |
A |
xCol |
Numeric or character, (name of) the columns of the underlying data
of the |
wCol |
Numeric, the columns of the scenario weights
of the |
Value
The empirical or KDE distribution function (a function) of
the xCol
component of the stressed model with weights
wCol
. The empirical distribution function can be
evaluated at a vector.
Author(s)
Silvana M. Pesenti, Zhuomin Mao
See Also
See plot_cdf
for plotting the empirical or KDE
distribution function of the stressed model 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(res1, xCol = 1, wCol = 1)(grid)
## baseline empirical distribution function
ecdf(x$normal)(grid)