plot.cv_tfCox: Plots Cross-Validation Curve for Object of Class "cv_tfCox"

Description Usage Arguments Author(s) See Also Examples

View source: R/Rfunctions.R

Description

This function plots the cross-validation curve for models fitted by a range of tuning parameter lambda using cv_tfCox. The cross-validation error with +/-1 standard error is plotted for each value of lambda. The dotted vertical line indicates the chosen lambda corresponding to the minimum cross-validation error.

Usage

1
2
## S3 method for class 'cv_tfCox'
plot(x, showSE=F, ...)

Arguments

x

an object of class "cv_tfCox"

showSE

a logical (TRUE or FALSE) for whether the standard errors of the curve should be plotted

...

additional arguments to be passed. These are ignored in this function.

Author(s)

Jiacheng Wu

See Also

cv_tfCox

Examples

1
2
3
4
5
6
7
8
#generate data
set.seed(123)
dat = sim_dat(n=100, zerof=0, scenario=1)

#fit piecewise constant functions
#cross-validation to choose the tuning parameter lambda with fixed alpha=1
cv = cv_tfCox(dat, ord=0, alpha=1, n.fold=2, seed=123)
plot(cv, showSE=TRUE)

tfCox documentation built on Aug. 1, 2019, 5:07 p.m.