R/plotcompmvr.R

Defines functions plotcompmvr

Documented in plotcompmvr

plotcompmvr <-
function(mvrdcvobj,...)
{
# Generate plot showing optimal number of components for
# Repeated Double Cross Validation 
#

pcr.dcv.optcomp=table(mvrdcvobj$optco)/sum(table(mvrdcvobj$optco))
plot(names(pcr.dcv.optcomp),pcr.dcv.optcomp,type="b",
  xlab="Number of components",ylab="Relative frequency for optimal number",
  cex.lab=1.2,...)
optcomp=as.numeric(names(which.max(pcr.dcv.optcomp)))
abline(v=optcomp,lty=2)

list(optcomp=optcomp,compdistrib=pcr.dcv.optcomp)
}

Try the chemometrics package in your browser

Any scripts or data that you put into this service are public.

chemometrics documentation built on Aug. 25, 2023, 5:18 p.m.