plot.SSI: Accuracy vs penalization plot

View source: R/methods.R

9. SSI accuracy vs penalization plotR Documentation

Accuracy vs penalization plot

Description

Accuracy as a function of the penalization plot for an object of the class 'SSI'

Usage

## S3 method for class 'SSI'
plot(..., x.stat = c("nsup","lambda"),
          y.stat = c("accuracy","MSE"),
          nbreaks.x=7)

Arguments

...

Other arguments to be passed:

  • One or more objects of the class 'SSI'

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

x.stat

(character) Either 'nsup' (number of non-zero regression coefficients entering in the prediction of a given testing individual) or 'lambda' (penalization parameter in log scale) to plot in the x-axis

y.stat

(character) Either 'accuracy' (correlation between observed and predicted values) or 'MSE' (mean squared error) to plot in the y-axis

nbreaks.x

(integer) Number of breaks in the x-axis

Value

Creates a plot of either accuracy or MSE versus either the support set size (average number of predictors with non-zero regression coefficient) or versus lambda.

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)
  
  plot(fm)
  plot(fm, main=expression('corr('*y[obs]*','*y[pred]*') vs sparsity'))   
  plot(fm, y.stat="MSE",ylab='Mean Square Error', xlab='Sparsity')     
  

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