plot.shrink: Plot shrink object

Description Usage Arguments Examples

View source: R/shrink.R

Description

Produces a plot for the cross validation errors, if available.

Usage

1
2
## S3 method for class 'shrink'
plot(x, type = c("line", "heatmap"), footnote = TRUE, ...)

Arguments

x

class object shrink.

type

produce either 'heatmap' or 'line' graph

footnote

option to print footnote of optimal values. Defaults to TRUE.

...

additional arguments.

Examples

 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)

SCPME documentation built on May 2, 2019, 3:42 a.m.