9. SSI accuracy vs penalization plot | R Documentation |
Accuracy as a function of the penalization plot for an object of the class 'SSI'
## S3 method for class 'SSI'
plot(..., x.stat = c("nsup","lambda"),
y.stat = c("accuracy","MSE"),
nbreaks.x=7)
... |
Other arguments to be passed:
|
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 |
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.
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.