em_converged(loglik, previous_loglik, tol =1e-04, check.increased =FALSE)
Arguments
loglik: numeric. Current value of the log-likelihood function.
previous_loglik: numeric. Value of the log-likelihood function at the previous iteration.
tol: numerical. The tolerance of the test. If |LL(t) - LL(t-1)| / avg < tol, where avg = (|LL(t)| + |LL(t-1)|)/2, then algorithm has converged.
check.increased: logical. Check if likelihood has increased.
Returns
A logical statement indicating whether EM algorithm has converged. if check.increased = TRUE, a vector with 2 elements indicating the convergence status and whether the likelihood has decreased.