plot.cv_tfCox {tfCox} | R Documentation |
Plots Cross-Validation Curve for Object of Class "cv_tfCox"
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
## 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
Examples
#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)
[Package tfCox version 0.1.0 Index]