Description Usage Arguments Value Examples
The gMIC Function for (Group) Variable Selection in Generalized Linear Model
1 2 3 4 5 6 | glm.gMIC(formula, family = c("gaussian", "binomial", "poisson"), data,
group = NULL, beta0 = NULL, criterion = "BIC", lambda0 = 0,
a0 = NULL, scale.x = FALSE, orthogonal.x = FALSE,
rounding.digits = 4, optim.method = "BFGS", lower = NULL,
upper = NULL, maxit.global = 100, maxit.local = 100,
epsilon = 1e-06, stepsize = 0.01, details = FALSE)
|
formula |
An object of class |
family |
A description of the error distribution and link function to be used in the model. Preferably for computational speed,
this is a character string naming a family function among the following three choices: |
data |
A data.frame in which to interpret the variables named in the |
group |
A vector indicating the group structure of the model. For example, assume that X has 4 columns and group=c(1,1,2,2). It means the first 2 features form a group of variables and the last 2 features form another group of variables. |
beta0 |
A vector eqaul to the initial value for the model parameter, default is NULL. |
criterion |
A string indicating the type of information criterion ("AIC" or "BIC") to approximate. Default is "BIC". |
lambda0 |
A number, the user-specified penalty parameter for model complexity. If |
a0 |
The approximation parameter of the gMIC method. |
scale.x |
A boolean indicating whether or not to studentize the features. Default is |
orthogonal.x |
A boolean indicating whether or not to orthogonalize the features within each group. Default is true. See |
rounding.digits |
Number of digits after the decimal point for rounding-up estiamtes. Default value is 4. |
optim.method |
Optimization method for gMIC, one of c("GenSA", "BFGS", "ADAM"), indicating we use GenSA, BFGS, or ADAM for gMIC optimmization. Default is BFGS. For unknown methods specified by user, the default with be used. |
lower |
The lower bounds for the search space in |
upper |
The upper bounds for the search space in |
maxit.global |
Maximum number of iterations allowed for the global optimization algorithm |
maxit.local |
Maximum number of iterations allowed for the local optimizaiton algorithm |
epsilon |
The convergence tolerance. |
stepsize |
The stepsize (or learning rate) for optim.method = "GD" and "ADAM". |
details |
Logical value: if |
A list of objects as follows,
The estimates for gamma, the standard error of gamma, pvalues of gamma, and estimates of beta.
The group-level p-values for each group of variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library(MASS)
library(Matrix)
n=500;a=100
sig <- function(k, rho){
m = matrix(rho,nrow=k,ncol=k)
diag(m) <- 1
return(m)
}
bt = c(1,1,1, .5,.5,.5, rep(0,24)); p = length(bt)
group = c(1,1,1, 2,2,2,rep(3:10,each=3))
rho1 = 0.1; rho2 = 0.6
COV = sig(p,rho1) + bdiag(rep(list(sig(3,rho2)),p/3))
set.seed(1234)
X = mvrnorm(n,rep(0,p),COV)
z = X%*%bt; pr = 1/(1+exp(-z))
y = rbinom(n,1,pr)
Xy = as.data.frame(cbind(X,y))
dim(Xy)
names(Xy) <- c(paste("X",1:30,sep=""),"y")
fit <- glm.gMIC(y~.-1,group=group,family="binomial",a0=a,data=Xy,orthogonal.x=T)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.