Description Usage Arguments Details Value Author(s) See Also Examples
Provides sample quantiles for components (random variables) of a stochastic model, corresponding to distribution functions under the scenario weights.
1 2 3 4 5 6 7 8 |
object |
A |
probs |
Vector of probabilities with values
in |
xCol |
Numeric or character vector, (names of) the columns of
the underlying data
of the |
wCol |
Numeric, the column of the scenario weights
of the |
type |
Character, one of |
base |
Logical, if |
type defines the choice of algorithm used for
calculating the estimate of the sample quantiles.
"quantile" corresponds to the default interpolation used in
quantile. Further options are
"(i-1)/(n-1)", "i/(n+1)", "i/n" the inverse of the
empirical distribution function, using, respectively,
(wt - 1)/T, wt/(T+1), wt/T, where wt is the
cumulative weight and T the total weight (usually total
sample size). See wtd.quantile
for further details on type, on which
quantile_stressed is based. type is ignored for
when evaluating quantiles for SWIMw objects.
Returns a matrix with estimates of the distribution quantiles
at the probabilities, probs, under the scenario weights
wCol.
Silvana M. Pesenti, Zhuomin Mao
See wtd.quantile on which the function
quantile_stressed is based.
See cdf for the empirical distribution function 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)
## stressed sample quantiles
quantile_stressed(res1, probs = seq(0.9, 0.99, 0.01), wCol = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.