# NOT RUN {
set.seed(0)
x <- as.data.frame(cbind(
"normal" = rnorm(1000),
"gamma" = rgamma(1000, shape = 2)))
res1 <- stress_wass(type = "RM", x = x,
alpha = 0.9, q_ratio = 1.05)
summary(res1)
## calling stress_RM_w directly
## stressing "gamma"
res2 <- stress_RM_w(x = x, alpha = 0.9,
q_ratio = 1.05, k = 2)
summary(res2)
# dual power distortion with beta = 3
# gamma = beta * u^{beta - 1}, beta > 0
gamma <- function(u){
.res <- 3 * u^2
return(.res)
}
res3 <- stress_wass(type = "RM", x = x,
gamma = gamma, q_ratio = 1.05)
summary(res3)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab