R/RcppExports.R

Defines functions grad_gmic adam_gmic pen_gmic

Documented in adam_gmic grad_gmic pen_gmic

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Gradient Function for gMIC
#' 
#' @param X The design matrix.
#' @param y The response vector
#' @param a The approximation parameter for gMIC.
#' @param lambda The gMIC penalization parameter.
#' @param gamma The optimization parameter.
#' @param group 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.
#' @param family The type of glm model, should be one of "gaussian", "binomial" or "poisson".
#' @export
#'
grad_gmic <- function(X, y, a, lambda, gamma, group, family) {
    .Call('_gMIC_grad_gmic', PACKAGE = 'gMIC', X, y, a, lambda, gamma, group, family)
}

#' The ADAM Algorithm for gMIC Optimization (experimental)
#' 
#' @param X Design matrix.
#' @param y The response vector.
#' @param a The approximation parameter for gMIC.
#' @param lambda The penalization parameter for gMIC, e.g., 2 for AIC and long(n) for BIC.
#' @param gamma The optimization parameter gamma.
#' @param group 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.
#' @param family The type of glm model, should be one of "gaussian", "binomial" or "poisson".
#' @param stepsize Stepsize for group coordinate descent.
#' @param tol Convergence tolerance.
#' @param maxit Maximum number of iterations.
#' @param b1 ADAM hyperparameter, default is 0.9.
#' @param b2 ADAM hyperparameter, default is 0.999.
#' @param e ADAM hyperparameter, default is to 1e-8.
#' @export
#'
adam_gmic <- function(X, y, a, lambda, gamma, group, family, stepsize, tol, maxit, b1 = 0.7, b2 = 0.9, e = 1.0e-8) {
    .Call('_gMIC_adam_gmic', PACKAGE = 'gMIC', X, y, a, lambda, gamma, group, family, stepsize, tol, maxit, b1, b2, e)
}

#' The Group MIC Penalty Function
#'
#' @param beta A p-dimensional vector containing the regression ceofficients.
#' @param group 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.
#' @param a The approximation parameter of the gMIC.
#' @return The gMIC penalty evaluated at beta.
#' @export
#'
pen_gmic <- function(beta, group, a) {
    .Call('_gMIC_pen_gmic', PACKAGE = 'gMIC', beta, group, a)
}
liqun730/gMIC documentation built on May 22, 2019, 11:52 p.m.