Methods_SSI: SSI methods

Summarize SSI resultsR Documentation

SSI methods

Description

Useful methods for retrieving and summarizing important results from the 'SSI' function's output

Usage

## S3 method for class 'SSI'
coef(object, ...)

## S3 method for class 'SSI'
fitted(object, ...)

## S3 method for class 'SSI'
summary(object, ...)

Arguments

object

An object of the class 'SSI'

...

Other arguments to be passed to coef method:

  • nsup: (numeric) Average (across testing individuals) number of non-zero regression coefficients. Only the coefficients for the lambda associated to nsup are returned as a 'matrix' with testing individuals in rows

  • iy: (integer vector) Index testing elements (stored in object$tst) to be considered. Only coefficients corresponding to the testing individuals object$tst[i] are returned

For fitted and summary methods:

  • y: (numeric vector) An optional response matrix

Value

Method fitted returns a matrix with the predicted values for each individual in the testing set (in rows) for each value of lambda (in columns).

Method coef (list of matrices) returns the regression coefficients for each testing set individual (elements of the list). Each matrix contains the coefficients for each value of lambda (in rows) associated to each training set individual (in columns).

Method summary returns a list object containing:

  • lambda: (vector) sequence of values of lambda used in the coefficients' estimation.

  • nsup: (vector) Number of non-zero coefficients (across testing individuals) at each solution associated to each value of lambda.

  • accuracy: (vector) correlation between observed and predicted values associated to each value of lambda.

  • MSE: (vector) mean squared error associated to each value of lambda.

  • optCOR: (vector) summary of the SSI with maximum accuracy.

  • optMSE: (vector) summary of the SSI with minimum MSE.

Examples

  require(SFSI)
  data(wheatHTP)
  
  index = which(Y$trial %in% 1:6)   # Use only a subset of data
  Y = Y[index,]
  M = scale(M[index,])/sqrt(ncol(M))  # Subset and scale markers
  G = tcrossprod(M)                   # Genomic relationship matrix
  y = as.vector(scale(Y[,"E1"]))      # Scale response variable
  
  # Sets (testing=0, training=1)
  trn_tst = ifelse(Y$trial == 2, 0, 1)
  
  fm = SSI(y,K=G,varU=0.4,varE=0.6,b=0,trn_tst=trn_tst)
  
  uHat = fitted(fm)             # Predicted values for each testing element
  out = summary(fm)             # Useful function to get results
  corTST = out$accuracy         # Testing set accuracy (correlation cor(y,yHat))
  out$optCOR                    # SSI with maximum accuracy
  out$optMSE                    # SSI with minimum MSE
  B = coef(fm)                  # Regression coefficients for all tst
  B = coef(fm, iy=1)            # Coefficients for first tst (tst[1])
  B = coef(fm, ilambda=10)      # Coefficients associated to the 10th lambda
  B = coef(fm, nsup=10)         # Coefficients for which nsup=10
  

SFSI documentation built on Nov. 18, 2023, 9:06 a.m.