
Cross-validation for the LASSO Kullback-Leibler divergence based regression.
cv.lasso.klcompreg(y, x, alpha = 1, nfolds = 10, folds = NULL,
seed = FALSE, graph = FALSE)
A numerical matrix with compositional data with or without zeros.
A matrix with the predictor variables.
The elastic net mixing parameter, with
The number of folds for the K-fold cross validation, set to 10 by default.
If you have the list with the folds supply it here. You can also leave it NULL and it will create folds.
If seed is TRUE the results will always be the same.
If graph is TRUE (default value) a filled contour plot will appear.
The outcome is the same as in the R package glmnet. The extra addition is that if "graph = TRUE", then the plot of the cross-validated object is returned. The contains the logarithm of
The K-fold cross validation is performed in order to select the optimal value for
Friedman, J., Hastie, T. and Tibshirani, R. (2010) Regularization Paths for Generalized Linear Models via Coordinate Descent. Journal of Statistical Software, Vol. 33(1), 1-22.
link{lasso.klcompreg}, lassocoef.plot, kl.compreg, ols.compreg, alfa.pcr, alfa.knn.reg
# NOT RUN {
library(MASS)
y <- rdiri( 214, runif(4, 1, 3) )
x <- as.matrix( fgl[, 2:9] )
x <- x / rowSums(x)
mod <- cv.lasso.klcompreg(y, x)
# }
Run the code above in your browser using DataLab