This function validates the parameters provided for setting up a catalytic Cox proportional hazards model
with an initialization object created by cat_cox_initialization
.
validate_cox_input(
formula,
cat_init,
tau = NULL,
tau_seq = NULL,
init_coefficients = NULL,
tol = NULL,
max_iter = NULL,
cross_validation_fold_num = NULL,
hazard_beta = NULL,
tau_alpha = NULL,
tau_gamma = NULL
)
Returns nothing if all checks pass; otherwise, raises an error or warning.
An object of class formula
. Specifies the model structure for the Cox model, including a Surv
object for survival analysis. Should at least include response variance.
An initialization object generated by cat_cox_initialization
. This object should contain necessary information about the dataset, including the time and status column names.
Optional. A numeric scalar, the regularization parameter for the Cox model. Must be positive.
Optional. A numeric vector for specifying a sequence of regularization parameters. Must be positive.
Optional. A numeric vector of initial coefficients for the Cox model. Should match the number of predictors in the dataset.
Optional. A positive numeric value indicating the tolerance level for convergence in iterative fitting.
Optional. A positive integer indicating the maximum number of iterations allowed in the model fitting.
Optional. A positive integer specifying the number of folds for cross-validation. Should be greater than 1 and less than or equal to the size of the dataset.
Optional. A positive numeric value representing a constant for adjusting the hazard rate in the Cox model.
Optional. A positive numeric value controlling the influence of tau
.
Optional. A positive numeric value controlling the influence of tau_seq
.
This function checks:
That tau
, tol
, max_iter
, cross_validation_fold_num
, hazard_beta
, tau_alpha
, and tau_gamma
are positive.
That tau_seq
is a non-negative vector.
That cat_init
is generated from cat_cox_initialization
.
That formula
uses the same time and status column names as those in cat_init
.
That init_coefficients
has the correct length for the number of predictors.
That cross_validation_fold_num
is between 2 and the dataset size.
That the dataset is sufficiently large for cross-validation, recommending fewer folds if it is not. If any conditions are not met, the function will raise an error or warning.