rename {SWIM} | R Documentation |
Rename Stressed Models
Description
Rename Stressed Models
Usage
rename(object, names, k = 1)
Arguments
object |
A |
names |
Character vector, the new names of k-th stressed model. |
k |
Numeric vector, the k-th stressed model of object to rename. ( |
Details
Get a new SWIM
object with desired name
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 ofx
, 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.
Author(s)
Kent Wu
Examples
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)