R/mc.glmnet.R

#' Multiple Core Multiple Model glmnet calculations
#'
#' Package mc.glmnet performs fit of L1 penalised model to the data. It is introduction 
#' to solution for Graphical Gaussion Models precission matrix. There had been used 
#' parallel computing in order to reduce time of computations. 
#'
#' For solving simple lasso problem, the number of predictors is usualy
#' reasonably small so the time of computations is not crutial. 
#' For Graphical Gaussian Models number of parameters to be estimated is
#' squared. 
#' 
#' The main function of package mc.glmnet is
#' \code{\link{mcmm.glmnet}} which allows to solve multiple Lasso problems 
#' using parallel computations. For large number of predictros solution presents 
#' significant better performance than usage of simple onee core computations.  
#'
#' We also provide function \code{\link{sm.glmnet}} that computes single model 
#' single L1 penalised model for generated inside data.  
#' 
#' Note that Windows users for propper evaluation of mcmm.glmnet and reduction 
#' in computation time, script available at http://www.stat.cmu.edu/~nmv/setup/mclapply.hack.R
#'
#' @docType package
#' @name mc.glmnet
#' @details Version: 0.1.1
#' @importFrom glmnet glmnet
#' @importFrom parallel mclapply
#' @author Jan Idziak
#' 
#' Maintainer: Jan Idziak \email{Jan.Idziak@@gmail.com}
#'
#' @examples
#' \donttest{
#' library(GeneNet)
#' graph.data.generate <- function(seed = 42048, fraction = 0.1, p = 500, n = 50, b.values = rep(2,50)){
#' set.seed(seed)
#' data <- list() 
#' precision <- ggm.simulate.pcor(p, fraction)
#' data$X <- ggm.simulate.data(n, precision)
#' beta <- c(b.values, rep(0, times = p-length(b.values)))
#' probs <- round(1/(1+(exp(-data$X%*%beta))), digits = 4)
#' data$Y <- rbinom(n, 1, probs)
#' return(data)}
#' sm.glmnet(graph.data.generate)
#' sm.glmnet(graph.data.generate, p = 500, n = 50)
#' sm.glmnet(graph.data.generate, fraction = 0.05 ,p = 500, n = 100)
#' mcmm.glmnet(graph.data.generate)
#' mcmm.glmnet(graph.data.generate, p = 500, n = 50)
#' mcmm.glmnet(graph.data.generate, fraction = 0.05 ,p = 500, n = 100)
#' }
NULL
jandziak/mc.glmnet documentation built on May 18, 2019, 12:23 p.m.