Learn R Programming

GDSARM (version 0.1.1)

dantzig.delta: Dantzig selector with an option to make profile plot

Description

The Dantzig selector (DS) finds a solution for the model parameters of a linear model, beta using linear programming. For a given delta, DS minimizes the L_1-norm (sum of absolute values) of beta subject to the constraint that max(|t(X)(y-X * beta)|) <= delta.

Usage

dantzig.delta(X, y, delta, plot = FALSE)

Value

A matrix of the estimated values of beta with each row corresponding to a particular value of delta.

Arguments

X

a design matrix.

y

a vector of responses.

delta

a vector with the values of delta for which the DS optimization needs to be solved.

plot

a boolean value of either TRUE or FALSE with TRUE indicating that the profile plot should be drawn.

See Also

GDS_givencols, GDSARM

Examples

Run this code
data(dataHamadaWu)
X = dataHamadaWu[,-8]
Y = dataHamadaWu[,8]
#scale and center X and y
scaleX = base::scale(X, center= TRUE, scale = TRUE)
scaleY = base::scale(Y, center= TRUE, scale = FALSE)
maxDelta = max(abs(t(scaleX)%*%matrix(scaleY, ncol=1)))
# Dantzig Selector on 4 equally spaced delta values between 0 and maxDelta
dantzig.delta(scaleX, scaleY, delta = seq(0,maxDelta,length.out=4)) 

Run the code above in your browser using DataLab