Learn R Programming

SWIM (version 1.0.0)

summary.SWIM: Summarising Stressed Models

Description

This function is a methods for an object of class SWIM or SWIMw. Provides summary statistics of the stochastic model, stressed using the scenario weights.

Usage

# S3 method for SWIM
summary(object, ..., xCol = "all", wCol = "all", base = FALSE)

# S3 method for SWIMw summary(object, ..., xCol = "all", wCol = "all", base = FALSE)

Arguments

object

A SWIM or SWIMw object.

...

Additional arguments will be ignored.

xCol

Numeric or character vector, (names of) the columns of the underlying data of the object (default = "all").

wCol

Vector, the columns of the scenario weights of the object corresponding to different stresses (default = "all").

base

Logical, if TRUE, statistics under the baseline are also returned (default = "FALSE").

Value

summary.SWIM returns a list with components corresponding to different stresses. Components contain a summary statistic of each column of the data of the SWIM object:

mean The sample mean.
sd The sample standard deviation.
skewness The sample skewness.
ex kurtosis The sample excess kurtosis
1st Qu. The 25% quantile.
Median The median, 50% quantile.

Functions

  • summary.SWIM: Summarising Stressed Models

  • summary.SWIMw: Summarising Stressed Models

See Also

summary, SWIM

Examples

Run this code
# NOT RUN {
     
## Example with the Relative Entropy
## continuing example in stress_VaR 
set.seed(0)
x <- as.data.frame(cbind(
  "normal" = rnorm(1000), 
  "gamma" = rgamma(1000, shape = 2)))
  
res1 <- stress(type = "VaR", x = x, 
  alpha = 0.9, q_ratio = 1.05)
summary(res1, xCol = "normal", base = TRUE) 


     
## Example with the Wasserstein distance 
# }
# NOT RUN {
resW <- stress_wass(type = "RM", x = x, 
alpha = 0.9, q_ratio = 1.05)
summary(resW, xCol = "normal", base = TRUE) 
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab