stress_mean_sd {SWIM} | R Documentation |
Stressing Mean and Standard Deviation
Description
Provides weights on simulated scenarios from a baseline stochastic model, such that stressed model components (random variables) fulfil the mean and standard deviation constraints. Scenario weights are selected by constrained minimisation of the relative entropy to the baseline model.
Usage
stress_mean_sd(
x,
k,
new_means,
new_sd,
normalise = TRUE,
names = NULL,
log = FALSE,
...
)
Arguments
x |
A vector, matrix or data frame
containing realisations of random variables. Columns of |
k |
Numeric vector, the columns of |
new_means |
Numeric vector, same length as |
new_sd |
Numeric vector, same length as |
normalise |
Logical. If true, values of |
names |
Character vector, the names of stressed models. |
log |
Boolean, the option to print weights' statistics. |
... |
Additional arguments to be passed to
|
Details
The function stress_mean_sd
is a wrapper for the
function stress_moment
. See stress_moment
for details on the additional arguments to ...
and
the underlying algorithm.
For stressing means only, see stress_mean
,
for stressing higher moments and functions of moments,
see stress_moment
.
Value
A SWIM
object containing:
-
x
, a data.frame containing the data; -
new_weights
, a list, each component corresponds to a different stress and is a vector of scenario weights; -
type = "mean"
; -
specs
, a list, each component corresponds to a different stress and containsk
,new_means
andnew_sd
.
See SWIM
for details.
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_w()
,
stress_mean()
,
stress_moment()
,
stress_prob()
,
stress_user()
,
stress_wass()
,
stress()
Examples
set.seed(0)
x <- data.frame(cbind(
"normal" = rnorm(1000),
"gamma" = rgamma(1000, shape = 2),
"beta" = rbeta(1000, shape1 = 2, shape2 = 2)))
## stressing mean and sd of column 1
res1 <- stress(type = "mean sd", x = x, k = 1, new_means = 0.1,
new_sd = 1.1, method = "Newton",
control = list(maxit = 1000, ftol = 1E-15))
summary(res1)
## calling stress_mean_sd directly
res2 <- stress_mean_sd(x = x, k = 1, new_means = 0.1,
new_sd = 1.1, method = "Newton",
control = list(maxit = 1000, ftol = 1E-15))
## See also examples in stress_moment.