dsps_fit | R Documentation |
dsp_fit
is used to fit the dynamic survival prediction.
It allows for both linear and Gaussian kernel as well as two time-discrete kernel, semi-linear and semi-Gaussian kernel as described in the manuscript.
A list of estimated parameters are returned.
dsps_fit(data, kernel, C, sigma = NULL)
data |
a data frame with time-dependent variables at unique event time points.
|
kernel |
the kernel to be used; Four types of kernels are currently supported: "linear", "gaussian", "semi_linear", "semi_gaussian" |
C |
a positive number, the penalty parameter that controls the penalty of mis-classification. |
sigma |
a positive number, the bandwidth parameter for "gaussian" and "semi_gaussian" kernel. |
A list of fitting results that can be passed to function dsp_predict
.
data_list <- sim_data(n=100, er=0.6) # Keep only at-risk observations train_data <- data_list$Z %>% filter(at_risk == 1) %>% select(-at_risk) fit <- dsps_fit(train_data, kernel="semi_linear", C=2^0) fit <- dsps_fit(train_data, kernel="semi_gaussian", sigma=2^0, C=2^0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.