Learn R Programming

HQM (version 2.0)

b_selection_index_optim: Cross validation index parameter selection

Description

Implements the index parameter selection for two markers based on K-fold cross validation.

Usage

b_selection_index_optim(in.par, data, marker_name1, marker_name2,  
          event_time_name = 'years', time_name = 'year', event_name = 'status2', I, b)

Value

A list with the tested parameters and its cross validation scores.

Arguments

in.par

Vector of candidate values for the index parameters.

data

A data frame of time dependent data points. Missing values are allowed.

marker_name1

The column name of the first marker values in the data frame data.

marker_name2

The column name of the second marker values in the data frame data.

event_time_name

The column name of the event times in the data frame data.

time_name

The column name of the times the marker values were observed in the data frame data.

event_name

The column name of the events in the data frame data.

I

Number of observations leave out for a K cross validation.

b

scalar bandwidth for the HQM estimator.

Details

The function b_selection_index_optim implements the cross validation index parameter selection for the indexing of two markers and given by $$ \hat \theta = arg min_{\theta_1, \theta_2} \sum_{i = 1}^N \int_0^T \int_s^T Z_i(t)Z_i(s)(\hat{h}_{\theta_0^T X_i(s)}(t-s)- h_{\theta_0^T X_i(s)}(t-s))^2 dt ds,$$ where \(\hat h_x(t)\) is the HQM estimator of \( h_x(t)\), see Bagkavos et al. (2025), tools:::Rd_expr_doi("10.1093/biomet/asaf008"), and \(Z_i\) the exposure process of individual \(i\). Note that \(\hat h_x(t)\) is dependent on \(b\).

References

Bagkavos, I., Isakson, R., Mammen, E., Nielsen, J., and Proust–Lima, C. (2025). Biometrika, 112(2), asaf008. tools:::Rd_expr_doi("10.1093/biomet/asaf008")

See Also

b_selection_prep_g, Q1, R_K, prep_cv, dataset_split

Examples

Run this code

# \donttest{
# Obtain the indexing parameters for the combination of albumin and bilirubin markers
# These are the values used in the example of function h_xt_vec
# and yielded the values:  (par.alb, par.bil) = ( 0.0702, 0.0856 ) that were used there.  

I = 26
b_list = seq(1.1, 1.2, by=0.1)

for(i in 1:length(b_list))
{
  res<- optim(c(0.5, 0.5), b_selection_index_optim,  data=pbc2, marker_name1='albumin', 
              marker_name2= 'serBilir', event_time_name = 'years', time_name = 'year', 
              event_name = 'status2', I=26, b=b_list[i], method="Nelder-Mead")
  cat("i= ", i, " ", res$par, " ", res$value, "count calls to fn = ", res$counts, " converge? ", 
        res$convergence,   "\n")
  res
}

# }

Run the code above in your browser using DataLab