Description Usage Arguments Value Examples
This function conducts SurvMKL for precomputed gramm matrices
1 |
K |
The multiple kernel cube (3-d array) |
y |
Vector of survival times |
del |
Indicator vector of whether an event occured (0 = no event, 1 = event occured) |
rho0 |
Argmin Dual objective function |
C |
cost parameter is the loss function |
lambda |
tuning parameter for the elastic net. Lambda closer 1 corresponds to L1 and closer to 0 corresponds to L2 penalties. |
maxiter |
maximum number of allowed iteratons for outer loop, default to be 500 |
cri |
change between to iterations is smaller than this, algorithms is considered to have converged, default to be .001 |
alpha coeffiencents of the dual of SurvMKL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## Not run:
library(RMKL)
library(kernlab)
data(Surv_data)
#Getting survival times in ascending order
ordtr <- order(Surv_data$time)
Surv_data_ordered = Surv_data[ordtr,]
xx = Surv_data_ordered[,1:2]
del = Surv_data_ordered$status
yy = Surv_data_ordered$time
if (!del[1]) {
first1 <- which(del)[1]
xx <- xx[-(1:(first1 - 1)), ]
yy <- yy[-(1:(first1 - 1))]
del <- del[-(1:(first1 - 1))]
nn <- dim(Surv_data)[1] - first1 + 1
} else {
nn <- dim(Surv_data)[1]
}
rho0 <- .001*(Surv_data$status - seq(0, 10, length.out = dim(Surv_data)[1]))
klist <- list(kernelMatrix(rbfdot(1), as.matrix(xx)),
kernelMatrix(vanilladot(), as.matrix(xx)))
ktlist <- list(kernelMatrix(rbfdot(1), as.matrix(xx), as.matrix(Surv_data[,1:2])),
kernelMatrix(vanilladot(), as.matrix(xx), as.matrix(Surv_data[,1:2])))
kk <- simplify2array(klist)
kkk <- simplify2array(ktlist)
modmkl <- SurvMKL(y = Surv_data$time, del = Surv_data$status, K = kk, rho =
rho0, C = 0.005, lambda = 0.5, maxiter = 500, cri = .01)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.