plotPath: Coefficients path plot

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
2
plotPath(fm, Z = NULL, K = NULL, tst = NULL, 
         title = NULL, maxCor = 0.85)

Arguments

fm

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'

tst

(integer vector) Which elements from vector y (stored in fm$y) are in testing set and to plot. They must be contained in fm$tst. Default tst=NULL will consider the whole vector fm$tst to plot

title

(character/expression) Title of the plot

maxCor

(numeric) Maximum correlation allowed for two different coefficients. A group of coeffcients with a correlation greater than maxCor are likely to overlap in the plot thus only one is kept

Value

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

Author(s)

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  require(SFSI)
  data(wheatHTP)
  
  index = which(Y$CV == 1)              # Use only a subset of data
  M = scale(M[index,])/sqrt(ncol(M))    # Subset and scale markers
  G = tcrossprod(M)                     # Genomic relationship matrix
  y = as.vector(scale(Y[index,"E1"]))   # Subset response variable
  X = scale(X_E1[index,])               # Reflectance data
  
  # Sparse phenotypic regression
  fm1 = lars2(var(X),cov(y,X))
  
  # Sparse family index
  fm2 = SSI(y,K=G,tst=1:10,trn=11:50)
  
  
  plotPath(fm1)
  plotPath(fm2,maxCor=0.6)
  plotPath(fm2,K=G,maxCor=0.6)
  
  
  # Path plot for the first individual in testing set for the SSI
  plotPath(fm2,K=G,tst=fm2$tst[1])

SFSI documentation built on Oct. 1, 2021, 1:08 a.m.