# NOT RUN {
#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)
# }
Run the code above in your browser using DataLab