Regression coefficients path {SFSI} | R Documentation |
Coefficients path plot
Description
Coefficients evolution path plot from an object of the class 'LASSO' or 'SGP'
Usage
path.plot(object, K = NULL, i = NULL,
prune = FALSE, cor.max = 0.97,
lambda.min = .Machine$double.eps^0.5,
nbreaks.x = 6, npaths.max = 5000, ...)
Arguments
object |
An object of the 'LASSO' or 'SGP' class |
K |
(numeric matrix) Kinship relationships. Only needed for an object of the class 'SGP' |
i |
(integer vector) Index a response variable (columns of matrix |
prune |
|
cor.max |
(numeric) Correlation threshold to prune within groups of correlated coefficients |
lambda.min |
(numeric) Minimum value of lambda to show in the plot as |
nbreaks.x |
(integer) Number of breaks in the x-axis |
npaths.max |
(integer) Maximum number of paths defined by the number of predictors times the number of columns of matrix |
... |
Other arguments for method |
Value
Returns the plot of the coefficients' evolution path along the regularization parameter
Examples
require(SFSI)
data(wheatHTP)
index = which(Y$trial %in% 1:6) # Use only a subset of data
Y = Y[index,]
X = scale(X_E1[index,]) # Reflectance data
M = scale(M[index,])/sqrt(ncol(M)) # Subset and scale markers
G = tcrossprod(M) # Genomic relationship matrix
y = as.vector(scale(Y[,'E1'])) # Subset response variable
# Sparse phenotypic regression
fm = LARS(var(X),cov(X,y))
path.plot(fm)
# Sparse Genomic Prediction
fm = SGP(y, K=G, trn=12:length(y), tst=1:11)
path.plot(fm, prune=TRUE)
path.plot(fm, K=G, prune=TRUE, cor.max=0.9)
# Path plot for the first individual in testing set for the SGP
path.plot(fm, K=G, i=1)