Learn R Programming

SWIM (version 1.0.0)

rename: Rename Stressed Models

Description

Rename Stressed Models

Usage

rename(object, names, k = 1)

Arguments

object

A SWIM or SWIMw object

names

Character vector, the new names of k-th stressed model.

k

Numeric vector, the k-th stressed model of object to rename. (default = 1).

Value

An renamed object of class SWIM containing:

  • x, a data.frame containing the data;

  • new_weights, a list, each component corresponds to a different stress and is either a vector of scenario weights or a function, that applied to a column of x, generates the vectors of scenario weights;

  • type, a list, each component corresponds to a different stress and specifies the type of the stress;

  • specs, a list, each component corresponds to a different stress and contains a list with the specifications of what has been stressed.

See SWIM for details.

Details

Get a new SWIM object with desired name

Examples

Run this code
# NOT RUN {
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)
res1 <- rename(res1, "VaR_09", 1)

# }

Run the code above in your browser using DataLab