Learn R Programming

GDSARM (version 0.1.1)

GDS_givencols: Gauss-Dantzig Selector

Description

This function runs the Gauss-Dantzig selector on the given columns. We have two options: either (a) GDS(m) on the m main effects, and (b) GDS(m+2fi) on the m main effects and the corresponding two-factor interactions. 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. The GDS is run for multiple values of delta. We use kmeans and BIC to select a best model.

Usage

GDS_givencols(delta.n = 10, design, Y, which.cols = c("main2fi"))

Value

A list returning the selected effects as well as the corresponding important factors.

Arguments

delta.n

a positive integer suggesting the number of delta values to be tried. delta.n equally spaced values of delta will be used strictly between 0 and max(|t(X)y|). The default value is set to 10.

design

a \(n \times m\) matrix of m two-level factors. The levels should be coded as +1 and -1.

Y

a vector of n responses.

which.cols

a string with either main or main2fi. Denotes whether the Gauss-Dantzig Selector should be run on the main effect columns (main), or on all main effects plus all 2 factor interaction columns (main2fi). The default value is main2fi.

See Also

GDSARM, dantzig.delta

Examples

Run this code
data(dataHamadaWu)
X = dataHamadaWu[,-8]
Y = dataHamadaWu[,8]
delta.n = 10
# GDS on main effects 
GDS_givencols(delta.n, design = X, Y=Y, which.cols = "main")

# GDS on main effects and two-factor interactions
GDS_givencols(delta.n, design = X, Y=Y)

data(dataCompoundExt)
X = dataCompoundExt[,-9]
Y = dataCompoundExt[,9]
delta.n = 10
# GDS on main effects
GDS_givencols(delta.n, design = X, Y=Y, which.cols = "main")
# GDS on main effects and two-factor interactions
GDS_givencols(delta.n, design = X, Y=Y, which.cols = "main2fi")

Run the code above in your browser using DataLab