Regression coefficients path | R Documentation |
Coefficients evolution path plot from an object of the class 'LASSO' or 'SSI'
path.plot(object, Z = NULL, K = NULL,
i = NULL, prune = FALSE, cor.max = 0.97,
lambda.min = .Machine$double.eps^0.5,
nbreaks.x=6, ...)
object |
An object of the 'LASSO' or 'SSI' class |
Z |
(numeric matrix) Design matrix for random effects. When |
K |
(numeric matrix) Kinship relationships. This can be a name of a binary file where the matrix is stored. Only needed for a |
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 |
... |
Other arguments for method |
Returns the plot of the coefficients' evolution path along the regularization parameter
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 family index
trn_tst = ifelse(seq_along(y)<11,0,1)
fm = SSI(y,K=G,trn_tst=trn_tst)
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 SSI
path.plot(fm, K=G, i=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.