R Under development (unstable) (2023-12-04 r85659 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > #source("charge.R") > library("LINselect") > > set.seed(15) # pour pouvoir comparer des exécutions sucessives > ex <- simulData(p=25,n=25,r=0.5,rSN=10) > > resVARselect <- VARselect(ex$Y,ex$X,exhaustive.dmax=4) [1] "LASSO PROCEDURE with option max.steps= 25 dmax= 18" [1] "ELASTIC-NET PROEDURE with options max.steps= 25 dmax= 18 en.lambda= 0.01 0.1 0.5 1 2 5" [1] "RIDGE PROCEDURE with options dmax= 18 ridge.lambda= 0.01 0.1 0.5 1 2 5" [1] "RANDOMFOREST PROCEDURE with option dmax= 18 rF.lmtry= 2" [1] "PLS PROCEDURE with options dmax= 18 pls.ncomp= 1 2 3 4 5" [1] "ADAPTIVE LASSO with WEIGHTS based on the RIDGE PROCEDURE" [1] "with options max.steps= 25 dmax= 18 ALridge.lambda= 0.01 0.1 0.5 1 2 5" [1] "ADAPTIVE LASSO with WEIGHTS based on the PLS PROCEDURE" [1] "with options max.steps= 25 dmax= 18 pls.ncomp= 1 2 3 4 5" [1] "EXHAUSTIVE PROCEDURE" [1] "dmax, the maximum number of selected variates equals 4" [1] "selection of the best 1 variates" [1] "the number of subsets of 1 variates among 25 equals 25" [1] "selection of the best 2 variates" [1] "the number of subsets of 2 variates among 25 equals 300" [1] "selection of the best 3 variates" [1] "the number of subsets of 3 variates among 25 equals 2300" [1] "selection of the best 4 variates" [1] "the number of subsets of 4 variates among 25 equals 12650" > resVARselect$summary $support $support[[1]] [1] 2 7 11 18 $crit [1] 2258.512 $method [1] "exhaustive" > > resVARselect <- + VARselect(ex$Y,ex$X,normalize=FALSE,dmax=15,exhaustive.dmax=4,verbose=FALSE) > resVARselect$summary $support $support[[1]] [1] 2 7 11 18 $crit [1] 2258.512 $method [1] "exhaustive" > > ## Time consuming > # X <- ex$X > # X[,1] <- X[,1]/10 > # X[,2] <- X[,3]*10 > # resVARselect <- VARselect(ex$Y,X,dmax=20,exhaustive.dmax=2,verbose=FALSE) > # resVARselect$summary > > # resVARselect <- VARselect(ex$Y,X,normalize=FALSE,dmax=20,exhaustive.dmax=2,verbose=FALSE) > # resVARselect$summary > # > # resVARselect <- VARselect(ex$Y,ex$X,method="exhaustive",exhaustive.maxdim=5000) > # resVARselect$summary > # > # resVARselect <- VARselect(ex$Y,ex$X,method="en",en.lambda=5,dmax=20) > # resVARselect$summary > # > # set.seed(15) > # ex <- simulData(p=100,n=100,r=0.5,rSN=10) > # > # methodF=c("lasso","ridge","pls","en","ALridge","ALpls","rF") > # resVARselect <- VARselect(ex$Y,ex$X,method=methodF) > # resVARselect$summary > # > # resVARselect <- VARselect(ex$Y,ex$X,method="rF",rF.lmtry=c(1,2,5)) > # resVARselect > > # > # set.seed(15) > # ex <- simulData(p=100,n=50,r=0.95,rSN=10) > # > # resVARselect <- VARselect(ex$Y,ex$X,method=methodF) > # resVARselect$summary > # > # set.seed(15) > # ex <- simulData(p=1000,n=200,r=0.95,rSN=10) > # methodF=c("lasso","ridge","pls","en","ALridge","ALpls") > # resVARselect <- VARselect(ex$Y,ex$X,method=methodF,dmax=50, > # en.lambda=c(0.01,1,5), > # ridge.lambda=c(0.01,1,5), > # ALridge.lambda=c(0.01,1,5)) > # resVARselect$summary > # > # set.seed(15) > # p <- 5000 > # n <- 100 > # X <- matrix(rnorm(n*p),ncol=p,nrow=n) > # Y <- rnorm(n) > # resVARselect <- VARselect(Y,X,method="ALpls",ALpls.ncomp=4,dmax=50) > # resVARselect > > > > > > > > > proc.time() user system elapsed 3.89 0.31 4.20