Learn R Programming

MVB (version 1.1)

mvblps: multivariate Bernoulli LASSO model fitting

Description

fit multivariate Bernoulli LASSO model accelerated block-coordinate relaxation algorithm.

Usage

mvblps(x, y, maxOrder = 2, lambda = NULL, nlambda = 100, lambda.min.ratio = ifelse(nobs

Arguments

x
input design matrix.
y
output binary matrix with number of columns equal to the number of outcomes per observation.
maxOrder
maximum order of interactions to be considered in outcomes.
lambda
a user specified tuning sequece. Typical usage is to have the program compute its own lambda.
nlambda
the number of lambda values, default is 100.
lambda.min.ratio
Smallest value for lambda, as a fraction of lambda.max. The default depends on the sample size nobs relative to the number of variables.
output
with values 0 or 1, indicating whether the fitting process is muted or not.
printIter
Number of iterations to be printed if output is true.
search
Tuning search approach, nm for Nelder Mead and grid for grid search.
tune
tuning approach, available methods including AIC, BIC, GACV, BGACV.

Value

An object of classes mvbfit and lps, for which some methods are available.

Details

The mvblps utilize the class structure of the underlying C++ code and fitted the model with accelerated block-coordinate relaxation algorithm.

See Also

mvbfit, unifit, stepfit, mvb.simu

Examples

Run this code
# fit a simple MVB log-linear model
n <- 1000
p <- 5
kk <- 2
tt <- NULL
alter <- 1
for (i in 1:kk) {
  vec <- rep(0, p)
  vec[i] <- alter
  alter <- alter * (-1)
  tt <- cbind(tt, vec)
}
tt <- 1.5 * tt
tt <- cbind(tt, c(rep(0, p - 1), 1))

x <- matrix(rnorm(n * p, 0, 4), n, p)
res <- mvb.simu(tt, x, K = kk, rep(.5, 2))
fitMVB <- mvblps(x, res$response, output = 1)

Run the code above in your browser using DataLab