Last data update: 2014.03.03

R: univariate model fitting with lasso penalty
unilpsR Documentation

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<nvars, .01, .0001),
       output = 0, tune = c("AIC", "BIC", "GACV", "BGACV"))

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.

Details

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

Value

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

See Also

unilps, mvblps

Examples

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')

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MVB)
Loading required package: Rcpp
Loading required package: RcppArmadillo
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MVB/unilps.Rd_%03d_medium.png", width=480, height=480)
> ### Name: unilps
> ### Title: univariate model fitting with lasso penalty
> ### Aliases: unilps
> 
> ### ** Examples
> 
> 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')
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>