sb
implements the Sequential Bifurcations screening
method (Bettonvil and Kleijnen 1996).sb(p, sign = rep("+", p), interaction = FALSE)
## S3 method for class 'sb':
ask(x, i = NULL, \dots)
## S3 method for class 'sb':
tell(x, y, \dots)
## S3 method for class 'sb':
print(x, \dots)
## S3 method for class 'sb':
plot(x, \dots)
p
filled with "+"
and
"-"
, giving the (assumed) signs of the factors effects.TRUE
if the model is supposed to
be with interactions, FALSE
otherwise."sb"
storing the state of the
screening study at the current iteration.sb
returns a list of class "sb"
, containing all
the input arguments detailed before, plus the following components:print
method.# a model with interactions
p <- 50
beta <- numeric(length = p)
beta[1:5] <- runif(n = 5, min = 10, max = 50)
beta[6:p] <- runif(n = p - 5, min = 0, max = 0.3)
beta <- sample(beta)
gamma <- matrix(data = runif(n = p^2, min = 0, max = 0.1), nrow = p, ncol = p)
gamma[lower.tri(gamma, diag = TRUE)] <- 0
gamma[1,2] <- 5
gamma[5,9] <- 12
f <- function(x) { return(sum(x * beta) + (x %*% gamma %*% x))}
# 10 iterations of SB
sa <- sb(p, interaction = TRUE)
for (i in 1 : 10) {
x <- ask(sa)
y <- list()
for (i in names(x)) {
y[[i]] <- f(x[[i]])
}
tell(sa, y)
}
print(sa)
plot(sa)
Run the code above in your browser using DataLab