cv_loglik | R Documentation |
logreg2ph
method. This function can be used to select the B-spline basis that yields the largest average predicted log likelihood.Performs cross-validation to calculate the average predicted log likelihood for the logreg2ph
method. This function can be used to select the B-spline basis that yields the largest average predicted log likelihood.
cv_loglik(
seed = 1,
interp = TRUE,
nfolds = 5,
Y_unval = NULL,
Y_val = NULL,
X_unval = NULL,
X_val = NULL,
C = NULL,
Validated = NULL,
Bspline = NULL,
data,
theta_pred = NULL,
gamma_pred = NULL,
TOL = 1e-04,
MAX_ITER = 1000
)
seed |
(For reproducibility in assigning the folds) an integer to specify the random number generator. |
interp |
Indicator of whether the B-spline coefficients in the testing data should be linearly interpolated from the training data. Defaults to |
nfolds |
Specifies the number of cross-validation folds. The default value is |
Y_unval |
Column name with the unvalidated outcome. If |
Y_val |
Column name with the validated outcome. |
X_unval |
Column name(s) with the unvalidated predictors. If |
X_val |
Column name(s) with the validated predictors. If |
C |
(Optional) Column name(s) with additional error-free covariates. |
Validated |
Column name with the validation indicator. The validation indicator can be defined as |
Bspline |
Vector of column names containing the B-spline basis functions. |
data |
A dataframe with one row per subject containing columns: |
theta_pred |
Vector of columns in |
gamma_pred |
Vector of columns in |
TOL |
Tolerance between iterations in the EM algorithm used to define convergence. Defaults to |
MAX_ITER |
Maximum number of iterations allowed in the EM algorithm. Defaults to |
avg_pred_loglike |
Stores the average predicted log likelihood. |
pred_loglike |
Stores the predicted log likelihoood in each fold. |
converged |
Stores the convergence status of the EM algorithm in each run. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.