predict_best_lambda: Predict from the optimal lambda from tfCox_choose_lambda

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/Rfunctions.R

Description

Estimate the corresponding theta values from the optimal tuning parameter obtained by tfCox_choose_lambda.

Usage

1

Arguments

cv

An object from tfCox_choose_lambda.

newX

The new covariate values.

Value

Estimated theta values.

Author(s)

Jiacheng Wu

References

Jiacheng Wu & Daniela Witten (2019) Flexible and Interpretable Models for Survival Data, Journal of Computational and Graphical Statistics, DOI: 10.1080/10618600.2019.1592758

See Also

tfCox_choose_lambda, negloglik

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#generate training and testing data
dat = sim_dat(n=100, zerof=0, scenario=1)
test_dat = sim_dat(n=100, zerof=0, scenario=1)

#choose the optimal tuning parameter
cv = tfCox_choose_lambda(dat, test_dat, ord=0, alpha=1)
plot(cv$lam_seq, cv$loss)

#optimal tuning parameter
cv$best_lambda

#Estimate the theta values of testing covariates from the optimal tuning parameter
#from tfCox_choose_lambda object. 
theta_hat = predict_best_lambda(cv, test_dat$X)

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