Description Usage Arguments Details See Also Examples
View source: R/plot.cv.pcLasso.R
Plots the cross-validation curve produced by a cv.pcLasso
object, along
with upper and lower standard deviation curves, as a function of the lambda
values used.
1 2 |
x |
Fitted " |
sign.lambda |
Either plot against |
orignz |
If |
... |
Other graphical paramters to plot. |
A plot is produced and nothing is returned.
pcLasso
and cv.pcLasso
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | set.seed(1)
x <- matrix(rnorm(100 * 20), 100, 20)
y <- rnorm(100)
groups <- vector("list", 4)
for (k in 1:4) {
groups[[k]] <- 5 * (k-1) + 1:5
}
cvfit <- cv.pcLasso(x, y, ratio = 0.8, groups = groups)
plot(cvfit)
# plot flipped: x-axis tracks -log(lambda) instead
plot(cvfit, sign.lambda = -1)
# if groups overlap, orignz can be used to decide which space to count the
# number of non-zero coefficients at the top
groups[[1]] <- 1:8
cvfit <- cv.pcLasso(x, y, ratio = 0.8, groups = groups)
plot(cvfit) # no. of non-zero coefficients in original space
plot(cvfit, orignz = FALSE) # no. of non-zero coefficients in expanded space
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.