Learn R Programming

MVB (version 1.1)

unilps: univariate model fitting with lasso penalty

Description

fit univariate log-linear model using accelerated block-coordinate relaxation algorithm.

Usage

unilps(formula, data = list(), family = c("gaussian", "binomial"), lambda = NULL, nlambda = 100, lambda.min.ratio = ifelse(nobs

Arguments

formula
a symbolic description of the model to be fit.
data
an optional data frame containing the variables in the model. By default the variables are taken from the environment from which unifit is called.
family
a GLM family, currently suport gaussian and binomial.
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.
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 unilps utilize the class structure of the underlying C++ code and fitted the model with accelerated block-coordinate relaxation algorithm.

See Also

unilps, mvblps

Examples

Run this code
n <- 100
p <- 4
x <- matrix(rnorm(n * p, 0, 4), n, p)
eta <- x 
pr <- exp(eta) / (1+ exp(eta))
res <- rbinom(n, 1, pr)
fit <- unilps(res ~ x - 1, family = 'binomial')

Run the code above in your browser using DataLab