R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 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 a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("lars-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('lars') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "cv.lars" > > ### * cv.lars > > flush(stderr()); flush(stdout()) > > ### Name: cv.lars > ### Title: Computes K-fold cross-validated error curve for lars > ### Aliases: cv.lars > ### Keywords: regression > > ### ** Examples > > data(diabetes) > attach(diabetes) > cv.lars(x2,y,trace=TRUE,max.steps=80) LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 37 added LARS Step 6 : Variable 20 added LARS Step 7 : Variable 19 added LARS Step 8 : Variable 43 added LARS Step 9 : Variable 28 added LARS Step 10 : Variable 22 added LARS Step 11 : Variable 2 added LARS Step 12 : Variable 12 added LARS Step 13 : Variable 11 added LARS Step 14 : Variable 33 added LARS Step 15 : Variable 24 added Lasso Step 16 : Variable 43 dropped LARS Step 17 : Variable 10 added LARS Step 18 : Variable 46 added LARS Step 19 : Variable 52 added LARS Step 20 : Variable 18 added LARS Step 21 : Variable 32 added LARS Step 22 : Variable 42 added LARS Step 23 : Variable 51 added LARS Step 24 : Variable 30 added LARS Step 25 : Variable 57 added LARS Step 26 : Variable 5 added LARS Step 27 : Variable 27 added LARS Step 28 : Variable 29 added LARS Step 29 : Variable 62 added LARS Step 30 : Variable 59 added LARS Step 31 : Variable 25 added LARS Step 32 : Variable 35 added LARS Step 33 : Variable 49 added LARS Step 34 : Variable 63 added LARS Step 35 : Variable 36 added LARS Step 36 : Variable 53 added Lasso Step 37 : Variable 18 dropped LARS Step 38 : Variable 1 added LARS Step 39 : Variable 39 added LARS Step 40 : Variable 61 added LARS Step 41 : Variable 44 added LARS Step 42 : Variable 17 added LARS Step 43 : Variable 38 added LARS Step 44 : Variable 47 added LARS Step 45 : Variable 50 added LARS Step 46 : Variable 48 added Lasso Step 47 : Variable 51 dropped LARS Step 48 : Variable 40 added Lasso Step 49 : Variable 39 dropped LARS Step 50 : Variable 18 added LARS Step 51 : Variable 8 added LARS Step 52 : Variable 26 added LARS Step 53 : Variable 43 added Lasso Step 54 : Variable 46 dropped LARS Step 55 : Variable 31 added LARS Step 56 : Variable 54 added LARS Step 57 : Variable 45 added LARS Step 58 : Variable 55 added Lasso Step 59 : Variable 59 dropped LARS Step 60 : Variable 46 added Lasso Step 61 : Variable 35 dropped LARS Step 62 : Variable 60 added Lasso Step 63 : Variable 46 dropped LARS Step 64 : Variable 16 added LARS Step 65 : Variable 21 added LARS Step 66 : Variable 14 added Lasso Step 67 : Variable 44 dropped Lasso Step 68 : Variable 50 dropped LARS Step 69 : Variable 41 added LARS Step 70 : Variable 34 added LARS Step 71 : Variable 39 added LARS Step 72 : Variable 35 added LARS Step 73 : Variable 23 added LARS Step 74 : Variable 15 added LARS Step 75 : Variable 46 added Lasso Step 76 : Variable 33 dropped LARS Step 77 : Variable 64 added LARS Step 78 : Variable 58 added Lasso Step 79 : Variable 64 dropped LARS Step 80 : Variable 33 added Computing residuals, RSS etc ..... CV Fold 1 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 37 added LARS Step 6 : Variable 19 added LARS Step 7 : Variable 20 added LARS Step 8 : Variable 12 added LARS Step 9 : Variable 22 added LARS Step 10 : Variable 2 added LARS Step 11 : Variable 10 added LARS Step 12 : Variable 27 added LARS Step 13 : Variable 28 added LARS Step 14 : Variable 30 added LARS Step 15 : Variable 11 added Lasso Step 16 : Variable 28 dropped LARS Step 17 : Variable 32 added LARS Step 18 : Variable 33 added LARS Step 19 : Variable 51 added LARS Step 20 : Variable 24 added LARS Step 21 : Variable 29 added LARS Step 22 : Variable 25 added LARS Step 23 : Variable 57 added LARS Step 24 : Variable 52 added LARS Step 25 : Variable 18 added LARS Step 26 : Variable 46 added LARS Step 27 : Variable 28 added LARS Step 28 : Variable 16 added LARS Step 29 : Variable 62 added LARS Step 30 : Variable 59 added LARS Step 31 : Variable 49 added LARS Step 32 : Variable 5 added LARS Step 33 : Variable 63 added LARS Step 34 : Variable 36 added LARS Step 35 : Variable 44 added LARS Step 36 : Variable 50 added LARS Step 37 : Variable 21 added LARS Step 38 : Variable 1 added Lasso Step 39 : Variable 51 dropped LARS Step 40 : Variable 45 added Lasso Step 41 : Variable 18 dropped Lasso Step 42 : Variable 44 dropped LARS Step 43 : Variable 53 added LARS Step 44 : Variable 42 added LARS Step 45 : Variable 55 added LARS Step 46 : Variable 44 added LARS Step 47 : Variable 61 added LARS Step 48 : Variable 43 added LARS Step 49 : Variable 13 added LARS Step 50 : Variable 26 added LARS Step 51 : Variable 64 added LARS Step 52 : Variable 18 added LARS Step 53 : Variable 8 added Lasso Step 54 : Variable 16 dropped LARS Step 55 : Variable 58 added LARS Step 56 : Variable 17 added LARS Step 57 : Variable 41 added LARS Step 58 : Variable 16 added Lasso Step 59 : Variable 64 dropped Lasso Step 60 : Variable 59 dropped LARS Step 61 : Variable 31 added LARS Step 62 : Variable 39 added LARS Step 63 : Variable 51 added LARS Step 64 : Variable 60 added Lasso Step 65 : Variable 16 dropped Lasso Step 66 : Variable 44 dropped LARS Step 67 : Variable 54 added LARS Step 68 : Variable 38 added LARS Step 69 : Variable 35 added LARS Step 70 : Variable 44 added LARS Step 71 : Variable 47 added Lasso Step 72 : Variable 51 dropped LARS Step 73 : Variable 40 added LARS Step 74 : Variable 15 added LARS Step 75 : Variable 59 added LARS Step 76 : Variable 51 added LARS Step 77 : Variable 48 added Lasso Step 78 : Variable 42 dropped LARS Step 79 : Variable 64 added LARS Step 80 : Variable 16 added Lasso Step 81 : Variable 45 dropped Computing residuals, RSS etc ..... CV Fold 2 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 20 added LARS Step 6 : Variable 12 added LARS Step 7 : Variable 19 added LARS Step 8 : Variable 37 added LARS Step 9 : Variable 22 added LARS Step 10 : Variable 28 added LARS Step 11 : Variable 2 added LARS Step 12 : Variable 27 added LARS Step 13 : Variable 34 added LARS Step 14 : Variable 10 added LARS Step 15 : Variable 32 added LARS Step 16 : Variable 30 added LARS Step 17 : Variable 60 added LARS Step 18 : Variable 29 added LARS Step 19 : Variable 46 added LARS Step 20 : Variable 18 added LARS Step 21 : Variable 11 added LARS Step 22 : Variable 44 added LARS Step 23 : Variable 52 added LARS Step 24 : Variable 57 added LARS Step 25 : Variable 59 added LARS Step 26 : Variable 63 added LARS Step 27 : Variable 62 added LARS Step 28 : Variable 24 added LARS Step 29 : Variable 49 added LARS Step 30 : Variable 33 added LARS Step 31 : Variable 5 added LARS Step 32 : Variable 15 added LARS Step 33 : Variable 25 added LARS Step 34 : Variable 38 added LARS Step 35 : Variable 1 added Lasso Step 36 : Variable 60 dropped LARS Step 37 : Variable 14 added LARS Step 38 : Variable 45 added Lasso Step 39 : Variable 15 dropped LARS Step 40 : Variable 53 added LARS Step 41 : Variable 60 added Lasso Step 42 : Variable 18 dropped LARS Step 43 : Variable 13 added LARS Step 44 : Variable 17 added LARS Step 45 : Variable 36 added LARS Step 46 : Variable 55 added Lasso Step 47 : Variable 14 dropped LARS Step 48 : Variable 26 added LARS Step 49 : Variable 35 added LARS Step 50 : Variable 61 added Lasso Step 51 : Variable 59 dropped LARS Step 52 : Variable 18 added LARS Step 53 : Variable 8 added LARS Step 54 : Variable 47 added LARS Step 55 : Variable 14 added LARS Step 56 : Variable 54 added Lasso Step 57 : Variable 14 dropped LARS Step 58 : Variable 40 added LARS Step 59 : Variable 43 added LARS Step 60 : Variable 42 added Lasso Step 61 : Variable 46 dropped LARS Step 62 : Variable 31 added LARS Step 63 : Variable 39 added Lasso Step 64 : Variable 42 dropped LARS Step 65 : Variable 64 added Lasso Step 66 : Variable 33 dropped LARS Step 67 : Variable 21 added LARS Step 68 : Variable 41 added LARS Step 69 : Variable 48 added LARS Step 70 : Variable 56 added LARS Step 71 : Variable 42 added LARS Step 72 : Variable 33 added LARS Step 73 : Variable 15 added LARS Step 74 : Variable 46 added LARS Step 75 : Variable 16 added LARS Step 76 : Variable 23 added Lasso Step 77 : Variable 45 dropped Lasso Step 78 : Variable 52 dropped LARS Step 79 : Variable 59 added LARS Step 80 : Variable 45 added Computing residuals, RSS etc ..... CV Fold 3 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 63 added LARS Step 6 : Variable 37 added LARS Step 7 : Variable 20 added LARS Step 8 : Variable 2 added LARS Step 9 : Variable 19 added LARS Step 10 : Variable 10 added LARS Step 11 : Variable 28 added LARS Step 12 : Variable 54 added LARS Step 13 : Variable 29 added LARS Step 14 : Variable 24 added LARS Step 15 : Variable 58 added LARS Step 16 : Variable 33 added LARS Step 17 : Variable 60 added LARS Step 18 : Variable 46 added LARS Step 19 : Variable 27 added LARS Step 20 : Variable 5 added Lasso Step 21 : Variable 54 dropped LARS Step 22 : Variable 47 added LARS Step 23 : Variable 17 added LARS Step 24 : Variable 49 added LARS Step 25 : Variable 1 added LARS Step 26 : Variable 51 added LARS Step 27 : Variable 22 added LARS Step 28 : Variable 62 added LARS Step 29 : Variable 57 added LARS Step 30 : Variable 25 added LARS Step 31 : Variable 11 added LARS Step 32 : Variable 32 added LARS Step 33 : Variable 54 added LARS Step 34 : Variable 30 added LARS Step 35 : Variable 59 added LARS Step 36 : Variable 42 added Lasso Step 37 : Variable 60 dropped Lasso Step 38 : Variable 58 dropped LARS Step 39 : Variable 64 added LARS Step 40 : Variable 36 added LARS Step 41 : Variable 58 added LARS Step 42 : Variable 35 added LARS Step 43 : Variable 13 added LARS Step 44 : Variable 41 added LARS Step 45 : Variable 52 added LARS Step 46 : Variable 12 added LARS Step 47 : Variable 61 added Lasso Step 48 : Variable 54 dropped LARS Step 49 : Variable 44 added LARS Step 50 : Variable 38 added LARS Step 51 : Variable 53 added Lasso Step 52 : Variable 46 dropped LARS Step 53 : Variable 43 added LARS Step 54 : Variable 8 added LARS Step 55 : Variable 18 added LARS Step 56 : Variable 50 added LARS Step 57 : Variable 26 added Lasso Step 58 : Variable 58 dropped LARS Step 59 : Variable 21 added LARS Step 60 : Variable 45 added LARS Step 61 : Variable 60 added LARS Step 62 : Variable 16 added LARS Step 63 : Variable 39 added Lasso Step 64 : Variable 59 dropped LARS Step 65 : Variable 54 added LARS Step 66 : Variable 34 added LARS Step 67 : Variable 46 added LARS Step 68 : Variable 31 added Lasso Step 69 : Variable 16 dropped LARS Step 70 : Variable 40 added LARS Step 71 : Variable 16 added LARS Step 72 : Variable 48 added Lasso Step 73 : Variable 42 dropped Lasso Step 74 : Variable 45 dropped LARS Step 75 : Variable 23 added Lasso Step 76 : Variable 51 dropped LARS Step 77 : Variable 42 added Lasso Step 78 : Variable 35 dropped LARS Step 79 : Variable 45 added LARS Step 80 : Variable 58 added Computing residuals, RSS etc ..... CV Fold 4 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 20 added LARS Step 6 : Variable 19 added LARS Step 7 : Variable 43 added LARS Step 8 : Variable 37 added LARS Step 9 : Variable 12 added LARS Step 10 : Variable 10 added LARS Step 11 : Variable 22 added LARS Step 12 : Variable 2 added LARS Step 13 : Variable 27 added LARS Step 14 : Variable 30 added LARS Step 15 : Variable 11 added LARS Step 16 : Variable 1 added LARS Step 17 : Variable 62 added LARS Step 18 : Variable 46 added LARS Step 19 : Variable 29 added LARS Step 20 : Variable 52 added LARS Step 21 : Variable 25 added LARS Step 22 : Variable 42 added LARS Step 23 : Variable 5 added LARS Step 24 : Variable 59 added LARS Step 25 : Variable 24 added LARS Step 26 : Variable 35 added LARS Step 27 : Variable 33 added LARS Step 28 : Variable 51 added LARS Step 29 : Variable 45 added LARS Step 30 : Variable 58 added LARS Step 31 : Variable 49 added LARS Step 32 : Variable 57 added LARS Step 33 : Variable 28 added LARS Step 34 : Variable 38 added LARS Step 35 : Variable 63 added LARS Step 36 : Variable 39 added LARS Step 37 : Variable 50 added LARS Step 38 : Variable 8 added Lasso Step 39 : Variable 51 dropped LARS Step 40 : Variable 36 added LARS Step 41 : Variable 53 added LARS Step 42 : Variable 13 added LARS Step 43 : Variable 64 added LARS Step 44 : Variable 61 added Lasso Step 45 : Variable 22 dropped LARS Step 46 : Variable 48 added LARS Step 47 : Variable 55 added LARS Step 48 : Variable 41 added LARS Step 49 : Variable 18 added Lasso Step 50 : Variable 58 dropped LARS Step 51 : Variable 17 added Lasso Step 52 : Variable 59 dropped LARS Step 53 : Variable 60 added LARS Step 54 : Variable 16 added Lasso Step 55 : Variable 39 dropped LARS Step 56 : Variable 54 added LARS Step 57 : Variable 26 added LARS Step 58 : Variable 31 added LARS Step 59 : Variable 22 added LARS Step 60 : Variable 44 added LARS Step 61 : Variable 34 added LARS Step 62 : Variable 40 added Lasso Step 63 : Variable 46 dropped LARS Step 64 : Variable 59 added Lasso Step 65 : Variable 38 dropped LARS Step 66 : Variable 51 added Lasso Step 67 : Variable 16 dropped LARS Step 68 : Variable 39 added LARS Step 69 : Variable 47 added LARS Step 70 : Variable 46 added LARS Step 71 : Variable 58 added Lasso Step 72 : Variable 47 dropped Lasso Step 73 : Variable 45 dropped Lasso Step 74 : Variable 62 dropped LARS Step 75 : Variable 32 added LARS Step 76 : Variable 21 added Lasso Step 77 : Variable 51 dropped Lasso Step 78 : Variable 33 dropped LARS Step 79 : Variable 16 added LARS Step 80 : Variable 51 added Computing residuals, RSS etc ..... CV Fold 5 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 37 added LARS Step 6 : Variable 22 added LARS Step 7 : Variable 28 added LARS Step 8 : Variable 20 added LARS Step 9 : Variable 43 added LARS Step 10 : Variable 2 added LARS Step 11 : Variable 12 added LARS Step 12 : Variable 19 added LARS Step 13 : Variable 11 added LARS Step 14 : Variable 27 added LARS Step 15 : Variable 30 added LARS Step 16 : Variable 18 added LARS Step 17 : Variable 54 added Lasso Step 18 : Variable 28 dropped LARS Step 19 : Variable 10 added LARS Step 20 : Variable 52 added LARS Step 21 : Variable 29 added LARS Step 22 : Variable 46 added LARS Step 23 : Variable 59 added LARS Step 24 : Variable 34 added LARS Step 25 : Variable 42 added Lasso Step 26 : Variable 43 dropped LARS Step 27 : Variable 25 added LARS Step 28 : Variable 33 added LARS Step 29 : Variable 44 added LARS Step 30 : Variable 5 added LARS Step 31 : Variable 24 added LARS Step 32 : Variable 55 added LARS Step 33 : Variable 49 added LARS Step 34 : Variable 57 added LARS Step 35 : Variable 53 added LARS Step 36 : Variable 61 added LARS Step 37 : Variable 62 added LARS Step 38 : Variable 43 added LARS Step 39 : Variable 21 added LARS Step 40 : Variable 41 added LARS Step 41 : Variable 39 added Lasso Step 42 : Variable 42 dropped LARS Step 43 : Variable 1 added LARS Step 44 : Variable 64 added Lasso Step 45 : Variable 18 dropped LARS Step 46 : Variable 42 added LARS Step 47 : Variable 63 added LARS Step 48 : Variable 28 added Lasso Step 49 : Variable 39 dropped LARS Step 50 : Variable 38 added LARS Step 51 : Variable 58 added LARS Step 52 : Variable 26 added Lasso Step 53 : Variable 54 dropped LARS Step 54 : Variable 18 added LARS Step 55 : Variable 17 added LARS Step 56 : Variable 50 added LARS Step 57 : Variable 16 added LARS Step 58 : Variable 32 added LARS Step 59 : Variable 54 added Lasso Step 60 : Variable 58 dropped Lasso Step 61 : Variable 59 dropped Lasso Step 62 : Variable 54 dropped Lasso Step 63 : Variable 42 dropped LARS Step 64 : Variable 13 added LARS Step 65 : Variable 60 added LARS Step 66 : Variable 31 added Lasso Step 67 : Variable 16 dropped LARS Step 68 : Variable 35 added LARS Step 69 : Variable 45 added LARS Step 70 : Variable 48 added Lasso Step 71 : Variable 45 dropped LARS Step 72 : Variable 23 added Lasso Step 73 : Variable 33 dropped LARS Step 74 : Variable 39 added LARS Step 75 : Variable 56 added LARS Step 76 : Variable 33 added LARS Step 77 : Variable 58 added Lasso Step 78 : Variable 13 dropped LARS Step 79 : Variable 42 added LARS Step 80 : Variable 8 added Lasso Step 81 : Variable 24 dropped Computing residuals, RSS etc ..... CV Fold 6 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 37 added LARS Step 6 : Variable 12 added LARS Step 7 : Variable 43 added LARS Step 8 : Variable 19 added LARS Step 9 : Variable 20 added LARS Step 10 : Variable 27 added LARS Step 11 : Variable 2 added LARS Step 12 : Variable 28 added LARS Step 13 : Variable 22 added LARS Step 14 : Variable 11 added LARS Step 15 : Variable 18 added LARS Step 16 : Variable 10 added LARS Step 17 : Variable 63 added LARS Step 18 : Variable 30 added Lasso Step 19 : Variable 28 dropped LARS Step 20 : Variable 32 added LARS Step 21 : Variable 52 added LARS Step 22 : Variable 34 added LARS Step 23 : Variable 59 added LARS Step 24 : Variable 29 added Lasso Step 25 : Variable 22 dropped LARS Step 26 : Variable 5 added LARS Step 27 : Variable 41 added LARS Step 28 : Variable 33 added LARS Step 29 : Variable 25 added LARS Step 30 : Variable 24 added LARS Step 31 : Variable 46 added LARS Step 32 : Variable 49 added LARS Step 33 : Variable 44 added LARS Step 34 : Variable 28 added LARS Step 35 : Variable 1 added LARS Step 36 : Variable 54 added LARS Step 37 : Variable 57 added LARS Step 38 : Variable 51 added LARS Step 39 : Variable 60 added Lasso Step 40 : Variable 41 dropped LARS Step 41 : Variable 17 added LARS Step 42 : Variable 35 added LARS Step 43 : Variable 61 added LARS Step 44 : Variable 62 added Lasso Step 45 : Variable 60 dropped Lasso Step 46 : Variable 51 dropped LARS Step 47 : Variable 48 added LARS Step 48 : Variable 53 added LARS Step 49 : Variable 60 added Lasso Step 50 : Variable 54 dropped LARS Step 51 : Variable 26 added Lasso Step 52 : Variable 18 dropped LARS Step 53 : Variable 13 added LARS Step 54 : Variable 8 added LARS Step 55 : Variable 64 added LARS Step 56 : Variable 50 added LARS Step 57 : Variable 38 added LARS Step 58 : Variable 55 added Lasso Step 59 : Variable 59 dropped LARS Step 60 : Variable 40 added LARS Step 61 : Variable 36 added LARS Step 62 : Variable 18 added LARS Step 63 : Variable 21 added Lasso Step 64 : Variable 62 dropped LARS Step 65 : Variable 31 added Lasso Step 66 : Variable 46 dropped LARS Step 67 : Variable 54 added LARS Step 68 : Variable 39 added LARS Step 69 : Variable 56 added LARS Step 70 : Variable 14 added Lasso Step 71 : Variable 33 dropped LARS Step 72 : Variable 62 added LARS Step 73 : Variable 45 added LARS Step 74 : Variable 16 added Lasso Step 75 : Variable 50 dropped Lasso Step 76 : Variable 16 dropped Lasso Step 77 : Variable 52 dropped LARS Step 78 : Variable 16 added LARS Step 79 : Variable 42 added LARS Step 80 : Variable 22 added Computing residuals, RSS etc ..... CV Fold 7 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 37 added LARS Step 6 : Variable 12 added LARS Step 7 : Variable 28 added LARS Step 8 : Variable 20 added LARS Step 9 : Variable 2 added LARS Step 10 : Variable 19 added LARS Step 11 : Variable 22 added LARS Step 12 : Variable 10 added LARS Step 13 : Variable 36 added LARS Step 14 : Variable 60 added LARS Step 15 : Variable 52 added LARS Step 16 : Variable 5 added LARS Step 17 : Variable 46 added LARS Step 18 : Variable 11 added LARS Step 19 : Variable 30 added LARS Step 20 : Variable 24 added LARS Step 21 : Variable 27 added LARS Step 22 : Variable 58 added LARS Step 23 : Variable 48 added LARS Step 24 : Variable 33 added LARS Step 25 : Variable 63 added LARS Step 26 : Variable 59 added LARS Step 27 : Variable 57 added LARS Step 28 : Variable 51 added LARS Step 29 : Variable 62 added LARS Step 30 : Variable 25 added LARS Step 31 : Variable 49 added LARS Step 32 : Variable 42 added LARS Step 33 : Variable 8 added LARS Step 34 : Variable 29 added LARS Step 35 : Variable 35 added LARS Step 36 : Variable 39 added LARS Step 37 : Variable 32 added LARS Step 38 : Variable 21 added LARS Step 39 : Variable 17 added LARS Step 40 : Variable 44 added LARS Step 41 : Variable 64 added LARS Step 42 : Variable 38 added LARS Step 43 : Variable 61 added Lasso Step 44 : Variable 59 dropped Lasso Step 45 : Variable 60 dropped LARS Step 46 : Variable 53 added LARS Step 47 : Variable 40 added Lasso Step 48 : Variable 39 dropped LARS Step 49 : Variable 50 added LARS Step 50 : Variable 18 added LARS Step 51 : Variable 34 added LARS Step 52 : Variable 60 added Lasso Step 53 : Variable 51 dropped LARS Step 54 : Variable 26 added LARS Step 55 : Variable 55 added LARS Step 56 : Variable 13 added LARS Step 57 : Variable 43 added LARS Step 58 : Variable 16 added LARS Step 59 : Variable 14 added Lasso Step 60 : Variable 58 dropped Lasso Step 61 : Variable 32 dropped Lasso Step 62 : Variable 7 dropped Lasso Step 63 : Variable 50 dropped Lasso Step 64 : Variable 62 dropped LARS Step 65 : Variable 54 added LARS Step 66 : Variable 39 added LARS Step 67 : Variable 6 added LARS Step 68 : Variable 31 added LARS Step 69 : Variable 47 added LARS Step 70 : Variable 15 added LARS Step 71 : Variable 32 added LARS Step 72 : Variable 59 added LARS Step 73 : Variable 56 added LARS Step 74 : Variable 1 added Lasso Step 75 : Variable 33 dropped LARS Step 76 : Variable 45 added LARS Step 77 : Variable 51 added Lasso Step 78 : Variable 46 dropped LARS Step 79 : Variable 62 added LARS Step 80 : Variable 46 added Computing residuals, RSS etc ..... CV Fold 8 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 37 added LARS Step 6 : Variable 20 added LARS Step 7 : Variable 12 added LARS Step 8 : Variable 19 added LARS Step 9 : Variable 22 added LARS Step 10 : Variable 10 added LARS Step 11 : Variable 2 added LARS Step 12 : Variable 30 added LARS Step 13 : Variable 28 added LARS Step 14 : Variable 27 added LARS Step 15 : Variable 5 added LARS Step 16 : Variable 32 added LARS Step 17 : Variable 57 added LARS Step 18 : Variable 52 added LARS Step 19 : Variable 24 added LARS Step 20 : Variable 11 added LARS Step 21 : Variable 51 added LARS Step 22 : Variable 34 added LARS Step 23 : Variable 46 added LARS Step 24 : Variable 25 added LARS Step 25 : Variable 63 added LARS Step 26 : Variable 29 added LARS Step 27 : Variable 59 added Lasso Step 28 : Variable 32 dropped LARS Step 29 : Variable 18 added LARS Step 30 : Variable 60 added LARS Step 31 : Variable 58 added LARS Step 32 : Variable 62 added Lasso Step 33 : Variable 60 dropped LARS Step 34 : Variable 33 added Lasso Step 35 : Variable 18 dropped LARS Step 36 : Variable 13 added LARS Step 37 : Variable 49 added LARS Step 38 : Variable 1 added LARS Step 39 : Variable 21 added LARS Step 40 : Variable 17 added LARS Step 41 : Variable 36 added LARS Step 42 : Variable 44 added LARS Step 43 : Variable 48 added LARS Step 44 : Variable 53 added LARS Step 45 : Variable 43 added LARS Step 46 : Variable 18 added LARS Step 47 : Variable 41 added LARS Step 48 : Variable 39 added LARS Step 49 : Variable 42 added Lasso Step 50 : Variable 59 dropped LARS Step 51 : Variable 61 added LARS Step 52 : Variable 35 added LARS Step 53 : Variable 50 added LARS Step 54 : Variable 60 added LARS Step 55 : Variable 26 added LARS Step 56 : Variable 47 added LARS Step 57 : Variable 31 added LARS Step 58 : Variable 38 added LARS Step 59 : Variable 14 added LARS Step 60 : Variable 55 added Lasso Step 61 : Variable 50 dropped Lasso Step 62 : Variable 51 dropped LARS Step 63 : Variable 56 added Lasso Step 64 : Variable 55 dropped LARS Step 65 : Variable 50 added Lasso Step 66 : Variable 58 dropped Lasso Step 67 : Variable 33 dropped Lasso Step 68 : Variable 42 dropped LARS Step 69 : Variable 8 added LARS Step 70 : Variable 32 added LARS Step 71 : Variable 55 added Lasso Step 72 : Variable 50 dropped LARS Step 73 : Variable 33 added LARS Step 74 : Variable 51 added LARS Step 75 : Variable 42 added LARS Step 76 : Variable 40 added LARS Step 77 : Variable 58 added LARS Step 78 : Variable 59 added LARS Step 79 : Variable 45 added LARS Step 80 : Variable 23 added Computing residuals, RSS etc ..... CV Fold 9 LASSO sequence Computing X'X ..... LARS Step 1 : Variable 3 added LARS Step 2 : Variable 9 added LARS Step 3 : Variable 4 added LARS Step 4 : Variable 7 added LARS Step 5 : Variable 22 added LARS Step 6 : Variable 19 added LARS Step 7 : Variable 20 added LARS Step 8 : Variable 37 added LARS Step 9 : Variable 12 added LARS Step 10 : Variable 2 added LARS Step 11 : Variable 28 added LARS Step 12 : Variable 10 added LARS Step 13 : Variable 11 added LARS Step 14 : Variable 60 added LARS Step 15 : Variable 46 added LARS Step 16 : Variable 33 added LARS Step 17 : Variable 30 added LARS Step 18 : Variable 29 added LARS Step 19 : Variable 5 added LARS Step 20 : Variable 47 added LARS Step 21 : Variable 38 added LARS Step 22 : Variable 24 added LARS Step 23 : Variable 57 added LARS Step 24 : Variable 52 added LARS Step 25 : Variable 34 added LARS Step 26 : Variable 49 added LARS Step 27 : Variable 40 added LARS Step 28 : Variable 62 added LARS Step 29 : Variable 27 added LARS Step 30 : Variable 59 added LARS Step 31 : Variable 1 added LARS Step 32 : Variable 25 added LARS Step 33 : Variable 43 added LARS Step 34 : Variable 41 added Lasso Step 35 : Variable 40 dropped LARS Step 36 : Variable 32 added Lasso Step 37 : Variable 47 dropped LARS Step 38 : Variable 21 added LARS Step 39 : Variable 51 added LARS Step 40 : Variable 45 added LARS Step 41 : Variable 17 added LARS Step 42 : Variable 61 added Lasso Step 43 : Variable 60 dropped Lasso Step 44 : Variable 51 dropped LARS Step 45 : Variable 13 added LARS Step 46 : Variable 50 added LARS Step 47 : Variable 47 added LARS Step 48 : Variable 55 added LARS Step 49 : Variable 63 added LARS Step 50 : Variable 18 added Lasso Step 51 : Variable 59 dropped LARS Step 52 : Variable 35 added LARS Step 53 : Variable 36 added LARS Step 54 : Variable 53 added LARS Step 55 : Variable 42 added LARS Step 56 : Variable 48 added LARS Step 57 : Variable 26 added LARS Step 58 : Variable 54 added LARS Step 59 : Variable 60 added LARS Step 60 : Variable 64 added LARS Step 61 : Variable 31 added LARS Step 62 : Variable 23 added Lasso Step 63 : Variable 35 dropped LARS Step 64 : Variable 16 added LARS Step 65 : Variable 39 added LARS Step 66 : Variable 40 added LARS Step 67 : Variable 56 added Lasso Step 68 : Variable 42 dropped Lasso Step 69 : Variable 16 dropped LARS Step 70 : Variable 14 added LARS Step 71 : Variable 44 added LARS Step 72 : Variable 16 added LARS Step 73 : Variable 58 added LARS Step 74 : Variable 59 added Lasso Step 75 : Variable 16 dropped Lasso Step 76 : Variable 24 dropped Lasso Step 77 : Variable 45 dropped LARS Step 78 : Variable 35 added Lasso Step 79 : Variable 33 dropped Lasso Step 80 : Variable 46 dropped Computing residuals, RSS etc ..... CV Fold 10 > detach(diabetes) > > > > cleanEx(); ..nameEx <- "lars" > > ### * lars > > flush(stderr()); flush(stdout()) > > ### Name: lars > ### Title: Fits Least Angle Regression, Lasso and Infinitesimal Forward > ### Stagewise regression models > ### Aliases: lars > ### Keywords: regression > > ### ** Examples > > data(diabetes) > par(mfrow=c(2,2)) > attach(diabetes) > object <- lars(x,y) > plot(object) > object2 <- lars(x,y,type="lar") > plot(object2) > object3 <- lars(x,y,type="for") # Can use abbreviations > plot(object3) > detach(diabetes) > > > > graphics::par(get("par.postscript", env = .CheckExEnv)) > cleanEx(); ..nameEx <- "plot.lars" > > ### * plot.lars > > flush(stderr()); flush(stdout()) > > ### Name: plot.lars > ### Title: Plot method for lars objects > ### Aliases: plot.lars > ### Keywords: hplot methods > > ### ** Examples > > data(diabetes) > attach(diabetes) > object <- lars(x,y) > plot(object) > detach(diabetes) > > > > cleanEx(); ..nameEx <- "predict.lars" > > ### * predict.lars > > flush(stderr()); flush(stdout()) > > ### Name: predict.lars > ### Title: Make predictions or extract coefficients from a fitted lars > ### model > ### Aliases: predict.lars coef.lars > ### Keywords: regression methods > > ### ** Examples > > data(diabetes) > attach(diabetes) > object <- lars(x,y,type="lasso") > ### make predictions at the values in x, at each of the > ### steps produced in object > fits <- predict.lars(object, x, type="fit") > ### extract the coefficient vector with L1 norm=4.1 > coef4.1 <- coef(object, s=4.1, mode="norm") # or > coef4.1 <- predict(object, s=4.1, type="coef", mode="norm") > detach(diabetes) > > > > ### *