plot.esabcv: Plot Bi-cross-validation(BCV) Errors

View source: R/plot_esaBcv.R

plot.esabcvR Documentation

Plot Bi-cross-validation(BCV) Errors

Description

Plot the average BCV entrywise MSE against the number of factors tried, with error bars and the best number of factors picked.

Usage

## S3 method for class 'esabcv'
plot(x, start.r = 0, end.r = NA,
  xlab = "Number of Factors", ylab = "BCV MSE",
  main = "Bi-cross-validation Error", col.line = "BLUE", ...)

Arguments

x

esabcv object, typically result of EsaBcv.

start.r

the starting number of factors to display in the plot.

end.r

the largest number of factors allowed to display in the plot. Default is NA, which means to make end.r as max.r.

xlab

title for the x axis.

ylab

title for the y axis.

main

title for the plot.

col.line

the line color.

...

other parameters to be passed through to plotting functions.

Details

The esabcv object contains the raw BCV result result.list, which is a matrix with dimension c(nRepeat, (max.r + 1)) where nRepeat is the number of BCV repeats and max.r is the maximum number of factors tried. If either tail of the error curve dominates, then the user has the option to change the start and end rank for plotting.

Value

A plot ploting the average BCV entrywise MSE against the number of factors tried (start.r to max.r + 1), with error bars (one standard deviation) in grey and selected number of factors marked by a red crossing.

Examples

## Not run: 
data(simdat)
result <- EsaBcv(simdat$Y)
plot(result)
plot(result, start.r = 1)


## End(Not run)

esaBcv documentation built on June 30, 2022, 5:05 p.m.

Related to plot.esabcv in esaBcv...