varSelection: Variable selection using different criteria

Description Usage Arguments Value Examples

Description

This function uses specified criteria to select the optimal subset from a list of subsets, given design matrix X and observation y.

Usage

1
2
varSelection(candidates, dat, criteria = c("BC"), penaltyBC = NULL,
  adaptiveBC = FALSE, methodPI = "BC")

Arguments

candidates

List of vectors each representing the indices of significant variables

dat

List containing design matrix X and observation y

criteria

Vector of strings ('GIC2, GICn, Cp, AIC, BIC, BC') indicating criteria to use

penaltyBC

Vector of non-default penalty values in using BC, default to NULL so that only the suggested value n^(1/3) will be considered

adaptiveBC

Boolean indicating whether to use adaptive BC, default to FALSE so that only the suggested value n^(1/3) will be considered

methodPI

String ('BC', 'Drop', or 'Both') indicating the method to calculate BC, default to 'BC'

Value

List (cri_opt) of indices of candidate subsets, each corresponding to a method (cri_name), along with parametricness index PI for each type of BC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n <- 150
p <- 200
X <- genDesignMat(n,p,0.5)
beta <- rep(0, p)
beta[c(99,199)] = c(10, 5)
mu <- X %*% as.matrix(beta, ncol=1)
y <- mu + stats::rnorm(n)
candidates <- vector('list', 0)
candidates[[1]] <- c(1, 99)
candidates[[2]] <- c(99, 199) 
candidates[[3]] <- c(1, 99, 199)
dat <- list(X = X, y= y)
res <- varSelection(candidates, dat)

JieGroup/bc documentation built on June 1, 2019, 12:48 p.m.