stress_prob {SWIM} | R Documentation |
Stressing Intervals
Description
Provides weights on simulated scenarios from a baseline stochastic model, such that a stressed model component (random variable) fulfils constraints on probability of disjoint intervals. Scenario weights are selected by constrained minimisation of the relative entropy to the baseline model.
Usage
stress_prob(x, prob, lower = NULL, upper, k = 1, names = NULL, log = FALSE)
Arguments
x |
A vector, matrix or data frame
containing realisations of random variables. Columns of |
prob |
Numeric vector, stressed probabilities corresponding to
the intervals defined through |
lower |
Numeric vector, left endpoints of the intervals. |
upper |
Numeric vector, right endpoints of the intervals. |
k |
Numeric, the column of |
names |
Character vector, the names of stressed models. |
log |
Boolean, the option to print weights' statistics. |
Details
The intervals are treated as half open intervals, that is
the lower endpoint are not included, whereas the upper endpoint
are included. If upper = NULL
, the intervals
are consecutive and prob
cumulative.
The intervals defined through lower
and upper
must
be disjoint.
Value
A SWIM
object containing:
-
x
, a data.frame containing the data; -
new_weights
, a list of functions, that applied to thek
th column ofx
, generate the vectors of scenario weights. Each component corresponds to a different stress; -
type = "prob"
; -
specs
, a list, each component corresponds to a different stress and containsk
,lower
,upper
andprob
.
See SWIM
for details.
Author(s)
Silvana M. Pesenti
References
Pesenti SM, Millossovich P, Tsanakas A (2019).
“Reverse sensitivity testing: What does it take to break the model?”
European Journal of Operational Research, 274(2), 654–670.
Pesenti S BAMPTA (2020).
“Scenario Weights for Importance Measurement (SWIM) - An R package for sensitivity analysis.”
Annals of Actuarial Science 15.2 (2021): 458-483. Available at SSRN: https://www.ssrn.com/abstract=3515274.
Csiszar I (1975). “I-divergence geometry of probability distributions and minimization problems.” The Annals of Probability, 146–158.
See Also
Other stress functions:
stress_HARA_RM_w()
,
stress_RM_mean_sd_w()
,
stress_RM_w()
,
stress_VaR_ES()
,
stress_VaR()
,
stress_mean_sd_w()
,
stress_mean_sd()
,
stress_mean_w()
,
stress_mean()
,
stress_moment()
,
stress_user()
,
stress_wass()
,
stress()
Examples
set.seed(0)
x <- rnorm(1000)
## consecutive intervals
res1 <- stress(type = "prob", x = x, prob = 0.008, upper = -2.4)
# probability under the stressed model
cdf(res1, xCol = 1)(-2.4)
## calling stress_prob directly
## multiple intervals
res2 <- stress_prob(x = x, prob = c(0.008, 0.06),
lower = c(-3, -2), upper = c(-2.4, -1.6))
# probability under the stressed model
cdf(res2, xCol = 1)(c(-2.4, -1.6)) - cdf(res2, xCol = 1)(c(-3, -2))