Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/cdf_multivariate.R
Provides the empirical distribution of a stressed model component (random variable) under the scenario weights
1 | cdf_stressed(object, xCol = 1, wCol = "all", grid, base = FALSE)
|
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").] |
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.
A matrix containing the empirical distribution function
applied to grid
of the xCol
components of the
stressed model with weights wCol
.
Kent Wu
See cdf
for the empirical distribution function of a stressed
model component and quantile_stressed
for sample quantiles of
a stressed model.
1 2 3 4 5 6 7 8 9 10 11 |
## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.