Implements the calculation of the hqm estimator on cross validation data sets. This is a preparation for the cross validation index selection technique for future conditional hazard rate estimation based on marker information data.
prep_cv2(in.par, data, data.id, marker_name1, marker_name2, event_time_name = 'years',
time_name = 'year',event_name = 'status2', n, I, b)A list of matrices for every cross validation data set with \(\hat{h}_x(t)\) for all \(x\) on the marker grid and \(t\) on the time grid.
Vector of candidate indexing values.
A data frame of time dependent data points. Missing values are allowed.
An id data frame obtained from to_id.
The column name of the marker values in the data frame data.
The column name of the marker values in the data frame data.
The column name of the event times in the data frame data.
The column name of the times the marker values were observed in the data frame data.
The column name of the events in the data frame data.
Number of individuals.
Number of observations leave out for a K cross validation.
Bandwidth.
The function splits the data set via dataset_split and calculates for every splitted data set the hqm estimator
$$\hat{h}_x(t) = \frac{\sum_{i=1}^n \int_0^T\hat{\alpha}_i(\theta_0^T X_i(t+s))Z_i(t+s)Z_i(s)K_{b}(x-\theta_0^T X_i(s))\mathrm {d}s}{\sum_{i=1}^n\int_0^TZ_i(t+s)Z_i(s)K_{b}(x-\theta_0^T X_i(s))\mathrm {d}s},$$
for all \(x\) on the marker grid and \(t\) on the time grid, where \(X\) is the marker, \(Z\) is the exposure and \(\alpha(z)\) is the marker-only hazard, see get_alpha for more details.
b_selection_index_optim