Cross-validation for the EM algorithm
cvEM(
ni,
si,
ti = NULL,
N_cv = NULL,
N_init = 20,
maxIter = 1000,
errorMin = 1e-07,
prior = list(a_FP = 2, b_FP = 2, a_FN = 2, b_FN = 2)
)A list with the following components:
A list of the models for each fold
A list of the predictions for each fold
Numeric vector of \(n_i\)'s, the total numbers of replicates for each individual
Numeric vector of \(s_i\)'s, the numbers of replicates equal to 1 for each individual
Numeric vector of \(t_i\)'s, the true values of the binary variable for each individual.
If NULL, the EM algorithm is used to estimate the parameters. Defaults to NULL. See details.
The number of folds. Defaults to 20.
The number of initializations if ti is not provided. Defaults to 20.
The maximum number of iterations if the EM algorithm is used. Defaults to 1e3.
The minimum error for convergence if the EM algorithm is used. Defaults to 1e-7.
A list of prior parameters for the model.
This function chooses its algorithm according to what is provided in the ti argument:
ti is fully providedThe function computes the Maximum-A-Posteriori estimate, with an explicit formula.
ti is not providedThe function uses the EM algorithm to estimate the parameters.
ti is partially providedThe function uses the EM algorithm to estimate the parameters.
classify_with_scores, EMFit
data("periodontal")
modelCV <- cvEM(periodontal$ni, periodontal$si)
Run the code above in your browser using DataLab