Description Usage Arguments Details Value Author(s) References See Also Examples
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.
1 |
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. |
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.
A SWIM object containing:
x, a data.frame containing the data;
new_weights, a list of functions, that applied to the
kth column of x, 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 contains k, lower,
upper and prob.
See SWIM for details.
Silvana M. Pesenti
Pesenti2019reverseSWIM
Pesenti2020SSRNSWIM
Csiszar1975SWIM
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()
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.