Package 'batchlasso'

Title: BatchLASSO
Description: A package for using the LASSO for ranking response-exposure pairs on the basis of the highest lambda for which they first appear in the active set
Authors: Louis Dijkstra [aut, cre]
Maintainer: Louis Dijkstra <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-11-01 03:53:49 UTC
Source: https://github.com/bips-hb/batchlasso

Help Index


Batch LASSO

Description

This function can be used to rank the response-exposure pairs from most to least "interesting". Simply using the resulting regression coefficients would be unwise, since the size of the coefficients cannot be compared from model to model. Instead, we use the tuning parameter, λ\lambda.

Each response variable in the given response matrix is regressed on all exposures in the matrix exposure. We determine for each exposure what the highest value of λ\lambda for which that variable is included for the first time in the regression model (i.e., its regression coefficient is non-zero). These λ\lambda-values can be compared across models.

Usage

batchLASSO(response, exposure, alpha = 1, verbose = TRUE)

Arguments

response

A binary matrix where each column is a response variable

exposure

A binary matrix where each column is an exposure

alpha

The elastic net mixing parameter (Default: 1.0 - LASSO)

verbose

Verbosity (Default: TRUE)

Value

A data frame with three columns

response

The response label (in case they are not given, they are simply numbered 1,2,3,...etc.)

exposure

The exposure label (in case they are not given, they are simply numbered 1,2,3,...etc.)

highest_lambda

The highest lambda for which the response-exposure pair where first added to the active set. The higher this value, the more "interesting" the pair

Examples

## Not run: 
n <- 100 # no. of observations
r <- 5 # no. of response variables
e <- 10 # no. of exposures

# random response and exposure matrices
response <- matrix(rbinom(r*n, 1, 0.5), n, r)
exposure <- matrix(rbinom(e*n, 1, 0.5), n, e)

batchLASSO(response, exposure)

## End(Not run)