lognb: utility function for grankp; log neg binom

View source: R/lognb.R

lognbR Documentation

utility function for grankp; log neg binom

Description

tmp

Usage

lognb(m, shape, scale)

Arguments

m

count

shape

shape

scale

scale

Details

tmp

Value

tmp

Author(s)

Newton

References

tmp

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function( m, shape, scale )
	{
	## negative binomial mass function; log
	## make sure m >= 0, shape >0, scale > 0
	## either m may be a vector, and shape and scale should be scalers
	## or m may be a scaler, and shape and scale are vectors
	tmp1 <- lgamma(m+shape) - lgamma(shape) - lgamma(m+1)
	tmp2 <- -shape*log(scale+1)
	tmp3 <- m*( log( scale ) - log( scale + 1 ) )
	ll <- tmp1 + tmp2 + tmp3
	return(  ll )
	}

wiscstatman/GammaRank documentation built on Oct. 30, 2022, 10:23 p.m.