Learn R Programming

SFSI (version 1.2.0)

path.plot: Coefficients path plot

Description

Coefficients evolution path plot from an object of the class 'LASSO' or 'SSI'

Usage

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, ...)

Value

Returns the plot of the coefficients' evolution path along the regularization parameter

Arguments

object

An object of the 'LASSO' or 'SSI' class

Z

(numeric matrix) Design matrix for random effects. When Z=NULL an identity matrix is considered (default) thus G = K; otherwise G = Z K Z' is used. Only needed for a fm object of the class 'SSI'

K

(numeric matrix) Kinship relationships. This can be a name of a binary file where the matrix is stored. Only needed for a fm object of the class 'SSI'

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 'SSI'. 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

...

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

Author

Marco Lopez-Cruz (maraloc@gmail.com) and Gustavo de los Campos

Examples

Run this code
  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
  fm1 = LARS(var(X),cov(X,y))
  
  # Sparse family index
  fm2 = SSI(y,K=G,tst=1:10,trn=11:50)
  # \donttest{
  path.plot(fm1)
  path.plot(fm2, prune=TRUE)
  path.plot(fm2, K=G, prune=TRUE, cor.max=0.9)
  # }
  # Path plot for the first individual in testing set for the SSI
  path.plot(fm2, K=G, i=1)

Run the code above in your browser using DataLab