Internal function for cv_plmm which calls plmm on a fold subset of the original data.
cvf(i, fold, type, cv_args, ...)a list with three elements:
a numeric vector with the loss at each value of lambda
a numeric value indicating the number of lambda values used
a numeric value with the predicted outcome (y hat) values at each lambda
Fold number to be excluded from fit.
n-length vector of fold-assignments.
A character argument indicating what should be returned from predict.plmm. If type == 'lp' predictions are based on the linear predictor, $X beta$. If type == 'individual' predictions are based on the linear predictor plus the estimated random effect (BLUP).
List of additional arguments to be passed to plmm.
Optional arguments to predict_within_cv