Description Usage Arguments Examples
Produces a plot for the cross validation errors, if available.
1 2 |
x |
class object shrink. |
type |
produce either 'heatmap' or 'line' graph |
footnote |
option to print footnote of optimal values. Defaults to TRUE. |
... |
additional arguments. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # generate some data
data = data_gen(n = 100, p = 5, r = 1)
# lasso penalized beta (print estimated omega)
lam.max = max(abs(t(data$X) %*% data$Y))
(shrink = shrink(X = data$X, Y = data$Y, B = cov(data$X, data$Y), lam.max = lam.max))
# print estimated beta
shrink$Z
# create heatmap of CV errors
plot(shrink, type = 'heatmap')
# create line graph of CV errors
plot(shrink)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.