R/converged.R

Defines functions converged

converged <- function(fit, step="init step", stop=FALSE){
	if (fit$convergence==1) {
		ret <- FALSE
		if (stop) stop(paste("iteration limit 'maxit' have been reached in", step, sep=" "))
	}
	else if (fit$convergence==10) {
		ret <- FALSE
		if (stop) stop(paste("Degenerancy of Nelder_Mead simplex", step, sep=" "))
	} else {
		ret <- TRUE
	}
	ret
} 

Try the flexrsurv package in your browser

Any scripts or data that you put into this service are public.

flexrsurv documentation built on June 7, 2023, 5:09 p.m.