R/gammaShRaFromModeSD.R

'gammaShRaFromModeSD' <- function(mode, sd)
{
	if (mode <= 0) {
		stop("mode must be > 0")
	}
	if (sd <= 0) {
		stop("sd must be > 0")
	}
	rate = (mode+sqrt(mode^2+4*sd^2))/(2*sd^2)
	shape = 1+mode*rate
	return(invisible(list(shape = shape, rate = rate)))
}
#EOF
ndbrown6/EMseq documentation built on Jan. 20, 2021, 2:36 a.m.