plot.cvCovEst {cvCovEst} | R Documentation |
The plot
method is a generic method for plotting objects
of class, "cvCovEst"
. The method is designed as a tool for diagnostic
and exploratory analysis purposes when selecting a covariance matrix
estimator using cvCovEst
.
## S3 method for class 'cvCovEst' plot( x, dat_orig, estimator = NULL, plot_type = c("summary"), stat = c("min"), k = NULL, leading = TRUE, abs_v = TRUE, switch_vars = FALSE, min_max = FALSE, ... )
x |
An object of class, |
dat_orig |
The |
estimator |
A |
plot_type |
A |
stat |
A |
k |
A |
leading |
A |
abs_v |
A |
switch_vars |
A |
min_max |
A |
... |
Additional arguments passed to the plot method. These are not explicitly used and should be ignored by the user. |
This plot method is designed to aide users in understanding the
estimation procedure carried out in cvCovEst()
. There are
currently four different values for plot_type
that can be called:
"eigen"
- Plots the eigenvalues associated with the
specified estimator
and stat
arguments in decreasing
order.
"risk"
- Plots the cross-validated risk of the specified
estimator
as a function of the hyperparameter values passed to
cvCovEst()
. This type of plot is only compatible with
estimators which take hyperparameters as arguments.
"heatmap"
- Plots a covariance heat map associated with the
specified estimator
and stat
arguments. Multiple
estimators and performance stats may be specified to produce grids of
heat maps.
"summary"
- Specifying this plot type will run all of the
above plots for the best performing estimator selected by
cvCovEst()
. These plots are then combined into a single
panel along with a table containing the best performing estimator
within each class. If the optimal estimator selected by
cvCovEst()
does not have hyperparameters, then the risk
plot is replaced with a table displaying the minimum, first quartile,
median, third quartile, and maximum of the cross-validated risk
associated with each class of estimator.
The stat
argument accepts five values. They each correspond to a
summary statistic of the cross-validated risk distribution within a class
of estimator. Possible values are:
"min"
- minimum
"Q1"
- first quartile
"median"
- median
"Q3"
- third quartile
"max"
- maximum
A plot object
cv_dat <- cvCovEst( dat = mtcars, estimators = c( thresholdingEst, sampleCovEst ), estimator_params = list( thresholdingEst = list(gamma = seq(0.1, 0.9, 0.1)) ), center = TRUE, scale = TRUE ) plot(x = cv_dat, dat_orig = mtcars)