Learn R Programming

esaBcv (version 1.2.1)

plot.esabcv: 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

"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.

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.

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.

Examples

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

Run the code above in your browser using DataLab