lognb: utility function for grankp; log neg binom

Description Usage Arguments Details Value Author(s) References Examples

View source: R/lognb.R

Description

tmp

Usage

1
lognb(m, shape, scale)

Arguments

m

count

shape

shape

scale

scale

Details

tmp

Value

tmp

Author(s)

Newton

References

tmp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
##---- 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 May 28, 2017, 4:34 a.m.