l0reg: Solve $l_0$-regularized least squres with Single Best...

Description Usage Arguments Examples

Description

This is the main function for solving $l_0$-regularized least squres for a given penalty parameter, based on the Single Best Replacement (SBR) algorithm originally proposed by Soussen et al (2011)

Usage

1
l0reg(X, y, lambda, control = list())

Arguments

X

A normalized n by p numeric design matrix

y

A normalized n vector of numeric response

lambda

A non-negative numeric penalty parameter

Examples

1
2
3
4
5
6
7
8
set.seed(777)
n <- 1000
p <- 200
X <- matrix(rnorm(n * p), n, p)
beta <- c(rep(5, 5), rep(0, p - 5)) / sqrt(n)
y <- X %*% beta + rnorm(n)
fit <- l0reg(X, y, lambda = 4)
fit

LSun/l0reg documentation built on May 24, 2019, 4:03 p.m.