Package: SWIM 1.0.0

Silvana M. Pesenti

SWIM: Scenario Weights for Importance Measurement

An efficient sensitivity analysis for stochastic models based on Monte Carlo samples. Provides weights on simulated scenarios from a stochastic model, such that stressed random variables fulfil given probabilistic constraints (e.g. specified values for risk measures), under the new scenario weights. Scenario weights are selected by constrained minimisation of the relative entropy to the baseline model. The 'SWIM' package is based on Pesenti S.M., Millossovich P., Tsanakas A. (2019) "Reverse Sensitivity Testing: What does it take to break the model" <openaccess.city.ac.uk/id/eprint/18896/> and Pesenti S.M. (2021) "Reverse Sensitivity Analysis for Risk Modelling" <https://www.ssrn.com/abstract=3878879>.

Authors:Silvana M. Pesenti [aut, cre], Alberto Bettini [aut], Pietro Millossovich [aut], Andreas Tsanakas [aut], Zhuomin Mao [ctb], Kent Wu [ctb]

SWIM_1.0.0.tar.gz
SWIM_1.0.0.zip(r-4.5)SWIM_1.0.0.zip(r-4.4)SWIM_1.0.0.zip(r-4.3)
SWIM_1.0.0.tgz(r-4.4-any)SWIM_1.0.0.tgz(r-4.3-any)
SWIM_1.0.0.tar.gz(r-4.5-noble)SWIM_1.0.0.tar.gz(r-4.4-noble)
SWIM_1.0.0.tgz(r-4.4-emscripten)SWIM_1.0.0.tgz(r-4.3-emscripten)
SWIM.pdf |SWIM.html
SWIM/json (API)
NEWS

# Install 'SWIM' in R:
install.packages('SWIM', repos = c('https://spesenti.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/spesenti/swim/issues

Datasets:

On CRAN:

6.30 score 7 stars 19 scripts 179 downloads 48 mentions 37 exports 71 dependencies

Last updated 3 years agofrom:4e9cd0b2b4. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 10 2024
R-4.5-winOKOct 10 2024
R-4.5-linuxOKOct 10 2024
R-4.4-winOKOct 10 2024
R-4.4-macOKOct 10 2024
R-4.3-winOKOct 10 2024
R-4.3-macOKOct 10 2024

Exports:cdfcdf_stressedconvert_SWIMw_to_SWIMcor_stressedES_stressedget_dataget_specsget_weightsget_weightsfunimportance_rankmean_stressedplot_cdfplot_histplot_quantileplot_sensitivityplot_weightsquantile_stressedrenamesd_stressedsensitivitystressstress_HARA_RM_wstress_meanstress_mean_sdstress_mean_sd_wstress_mean_wstress_momentstress_probstress_RM_mean_sd_wstress_RM_wstress_userstress_VaRstress_VaR_ESstress_wasssummary_weightsvar_stressedVaR_stressed

Dependencies:backportsbase64encbslibcachemcheckmatecliclustercolorspacedata.tabledigestevaluatefansifarverfastmapfontawesomeforeignFormulafsggplot2gluegridExtragtablehighrHmischtmlTablehtmltoolshtmlwidgetsisobandjquerylibjsonliteknitrlabelinglatticelifecyclemagrittrMASSMatrixmemoisemgcvmimemunsellnleqslvnlmennetpillarpkgconfigplyrR6rappdirsrbibutilsRColorBrewerRcppRdpackreshape2rlangrmarkdownrpartrstudioapisassscalesstringistringrtibbletinytexutf8vctrsviridisviridisLitewithrxfunyaml

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

Rendered fromSWIM-vignette.Rmdusingknitr::rmarkdownon Oct 10 2024.

Last update: 2020-09-21
Started: 2020-05-20

Readme and manuals

Help Manual

Help pageTopics
Distribution Function of a Stressed Modelcdf
Empirical Distribution Function of a Stressed Modelcdf_stressed
Convert SWIMw to SWIMconvert_SWIMw_to_SWIM
Correlation of a Stressed Modelcor_stressed
Credit data setcredit_data
Value-at-Risk and Expected Shortfall of a Stressed ModelES_stressed VaR_stressed
Extracting from a Stressed Modelget_data get_specs get_weights get_weightsfun summary_weights
Importance Ranking for a Stressed Modelimportance_rank
Mean of a Stressed Modelmean_stressed
Merging Two Stressed Modelsmerge.SWIM
Merging Two Stressed Modelsmerge.SWIMw
Plotting the Distribution Functions of a Stressed Modelplot_cdf
Plotting Histograms of a Stressed Modelplot_hist
Plotting Quantile Functions of a Stressed Modelplot_quantile
Plotting Sensitivities of a Stressed Modelplot_sensitivity
Plotting the scenario weights of a Stressed Modelplot_weights
Sample Quantiles of a Stressed Modelquantile_stressed
Rename Stressed Modelsrename
Standard Deviation and Variance of a Stressed Modelsd_stressed var_stressed
Sensitivities of a Stressed Modelsensitivity
Stressing Random Variablesstress
Stressing Risk Measure and HARA Utilitystress_HARA_RM_w
Stressing Meansstress_mean
Stressing Mean and Standard Deviationstress_mean_sd
Stressing Mean and Standard Deviationstress_mean_sd_w
Stressing Meanstress_mean_w
Stressing Momentsstress_moment
Stressing Intervalsstress_prob
Stressing Risk Measure, Mean and Standard Deviationstress_RM_mean_sd_w
Stressing Risk Measurestress_RM_w
User Defined Stressstress_user
Stressing Value-at-Riskstress_VaR
Stressing Value-at-Risk and Expected Shortfallstress_VaR_ES
Stressing Random Variables Using Wasserstein Distancestress_wass
Summarising Stressed Modelssummary.SWIM summary.SWIMw
SWIM: A Package for Sensitivity AnalysisSWIM