Hostname: page-component-74656f9884-rngvg Total loading time: 0 Render date: 2026-11-05T16:16:12.349Z Has data issue: false hasContentIssue false

Scenario Weights for Importance Measurement (SWIM) – an R package for sensitivity analysis

Published online by Cambridge University Press:  12 May 2021

Silvana M. Pesenti*
Affiliation:
Department of Statistical Sciences, University of Toronto, Toronto, M5G 1X6, Canada
Alberto Bettini
Affiliation:
Assicurazioni Generali S.p.A, Trieste, 34132, Italy
Pietro Millossovich
Affiliation:
DEAMS, University of Trieste, Trieste, 34127, Italy Faculty of Actuarial Science and Insurance, The Business School (formerly Cass), City, University of London, London, EC1Y 8TZ, United Kingdom
Andreas Tsanakas
Affiliation:
Faculty of Actuarial Science and Insurance, The Business School (formerly Cass), City, University of London, London, EC1Y 8TZ, United Kingdom
*
*Corresponding author. E-mail: silvana.pesenti@utoronto.ca
Rights & Permissions [Opens in a new window]

Abstract

The Scenario Weights for Importance Measurement (SWIM) package implements a flexible sensitivity analysis framework, based primarily on results and tools developed by Pesenti et al. (2019). SWIM provides a stressed version of a stochastic model, subject to model components (random variables) fulfilling given probabilistic constraints (stresses). Possible stresses can be applied on moments, probabilities of given events, and risk measures such as Value-At-Risk and Expected Shortfall. SWIM operates upon a single set of simulated scenarios from a stochastic model, returning scenario weights, which encode the required stress and allow monitoring the impact of the stress on all model components. The scenario weights are calculated to minimise the relative entropy with respect to the baseline model, subject to the stress applied. As well as calculating scenario weights, the package provides tools for the analysis of stressed models, including plotting facilities and evaluation of sensitivity measures. SWIM does not require additional evaluations of the simulation model or explicit knowledge of its underlying statistical and functional relations; hence, it is suitable for the analysis of black box models. The capabilities of SWIM are demonstrated through a case study of a credit portfolio model.

Information

Type
Paper
Copyright
© The Author(s), 2021. Published by Cambridge University Press on behalf of Institute and Faculty of Actuaries
Figure 0

Table 1. Illustration of the SWIM framework, that is the baseline model, the stressed model, and the scenario weights.

Figure 1

Figure 1 Baseline and stressed empirical distribution functions of model components $Z_1$ (left) and Y (right), subject to a stress on the mean of $Z_1$.

Figure 2

Figure 2 Scenario weights against observations of model components $Z_1$ (left) and Y (right), subject to a stress on the mean of $Z_1$.

Figure 3

Figure 3 Scenario weights for observations of model components $Z_1$, $Z_2$ subject to a stress on the mean of $Z_1$.

Figure 4

Figure 4 Baseline and stressed empirical distribution functions of model components $Z_1$ (left) and Y (right), subject to a stress on the standard deviation of $Z_1$.

Figure 5

Figure 5 Scenario weights against observations of model components $Z_1$ (left) and Y (right), subject to a stress on the standard deviation of $Z_1$.

Figure 6

Table 2. Implemented types of stresses in SWIM.

Figure 7

Table 3. The SWIM object, returned by any stress function.

Figure 8

Table 4. Implemented R function in SWIM for analysing stressed models.

Figure 9

Table 5. The output of the summary function applied to a SWIM object.

Figure 10

Table 6. Definition of the sensitivity measures implemented in SWIM.

Figure 11

Figure 6 Scenario weights against the portfolio loss L for stressing VaR (left) and stressing both VaR and ES (right).

Figure 12

Figure 7 Histogram of the portfolio loss L under the baseline and the two stressed models.

Figure 13

Figure 8 Distribution functions and histograms of the subportfolios $L_1, L_2, L_3$ for the stresses on the VaR (stress 1) and on both the VaR and ES (stress 2) of the portfolio loss L.

Figure 14

Figure 9 Quantiles of the aggregate loss L under the baseline (blue), the stress on the tails of $L_2$ and $L_3$ (red), and the additional stress on the joint tail of $L_2$ and $L_3$ (green).