This function validates the parameters needed for fitting a catalytic Linear Mixed Model (LMM) or Generalized Linear Model (GLM),
specifically for the use with the categorical initialization from cat_lmm_initialization
.
validate_lmm_input(
cat_init,
tau = NULL,
residual_variance_0 = NULL,
random_effect_variance_0 = NULL,
coefs_0 = NULL,
optimize_domain = NULL,
max_iter = NULL,
tol = NULL,
tau_seq = NULL,
cross_validation_fold_num = NULL
)
Returns nothing if all checks pass; otherwise, raises an error.
An object of class cat_initialization
, typically generated from the cat_lmm_initialization
function.
A positive numeric value specifying the penalty parameter for the model.
A positive numeric value for the initial residual variance estimate.
A positive numeric value for the initial random effect variance estimate.
A numeric vector of length equal to the number of columns in the observation matrix. This represents the initial values for the model coefficients.
A numeric vector of length 2 specifying the domain for the optimization procedure.
A positive integer specifying the maximum number of iterations for the optimization.
A positive numeric value indicating the tolerance level for convergence.
A numeric vector representing a sequence of values for the penalty parameter.
A positive integer specifying the number of folds for cross-validation.
This function performs the following checks:
Ensures that tau
, tau_seq
, residual_variance_0
, random_effect_variance_0
, optimize_domain
, max_iter
, and tol
are positive values.
Verifies that cat_init
is an object generated by cat_lmm_initialization
.
Checks if coefs_0
has the same length as the number of columns in the observation matrix of cat_init
.
Ensures optimize_domain
is a numeric vector of length 2.
Confirms that cross_validation_fold_num
is greater than 1 and less than the number of observations in cat_init
.
If any of these conditions are not met, the function raises an error to guide the user.