gmu_lasso: Generalized Matrix Uncertainty Lasso

View source: R/gmu_lasso.R

gmu_lassoR Documentation

Generalized Matrix Uncertainty Lasso

Description

Generalized Matrix Uncertainty Lasso

Usage

gmu_lasso(
  W,
  y,
  lambda = NULL,
  delta = NULL,
  family = "binomial",
  active_set = TRUE,
  maxit = 1000
)

Arguments

W

Design matrix, measured with error. Must be a numeric matrix.

y

Vector of responses.

lambda

Regularization parameter. If not set, lambda.min from glmnet::cv.glmnet is used.

delta

Additional regularization parameter, bounding the measurement error.

family

Character string. Currently "binomial" and "poisson" are supported.

active_set

Logical. Whether or not to use an active set strategy to speed up coordinate descent algorithm.

maxit

Maximum number of iterations of iterative reweighing algorithm.

Value

An object of class "gmu_lasso".

References

\insertRef

rosenbaum2010hdme

\insertRef

sorensen2018hdme

Examples

set.seed(1)
# Number of samples
n <- 200
# Number of covariates
p <- 100
# Number of nonzero features
s <- 10
# True coefficient vector
beta <- c(rep(1,s),rep(0,p-s))
# Standard deviation of measurement error
sdU <- 0.2
# True data, not observed
X <- matrix(rnorm(n*p),nrow = n,ncol = p)
# Measured data, with error
W <- X + sdU * matrix(rnorm(n * p), nrow = n, ncol = p)
# Binomial response
y <- rbinom(n, 1, (1 + exp(-X%*%beta))**(-1))
# Run the GMU Lasso
fit <- gmu_lasso(W, y, delta = NULL)
print(fit)
plot(fit)
coef(fit)
# Get an elbow plot, in order to choose delta.
plot(fit)



osorensen/hdme documentation built on May 18, 2023, 11:35 p.m.