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 Gamma) for an object of the class 'LASSO'. Index testing elements (stored in object$tst) for an object of the class 'SGP'. Default i = NULL will consider either all columns in matrix Gamma or all elements in object$tst, respectively

prune

TRUE or FALSE to whether prune within groups of correlated coefficients, keeping only one per group. A group of coefficients that are highly correlated are likely to overlap in the plot

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 -log(lambda). This prevents -log(lambda) going to infinite for near-zero lambda values

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 Gamma for an object of the class 'LASSO'. This correspond to the number of training elements (stored in object$trn) times the number of testing elements (stored in object$tst) for an object of the class 'SGP'

...

Other arguments for method plot: 'xlab', 'ylab', 'main', 'lwd'

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)

[Package SFSI version 1.4 Index]