nbrat: a utility function for grankp.. ratio of negative binomials

View source: R/nbrat.R

nbratR Documentation

a utility function for grankp.. ratio of negative binomials

Description

ratio of nb

Usage

nbrat(m, n, shape, scale)

Arguments

m

tmp

n

tmp

shape

tmp

scale

tmp

Value

tmp

Author(s)

M A Newton

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, n, shape , scale )
 {
  ## returns the non-logged ratio p(m)/p(n)  of Neg binomial masses
  
  tmp1 <- lgamma(m+shape)-lgamma(n+shape)+lgamma(n+1)-lgamma(m+1)
  tmp2 <- (m-n) * ( log(scale) - log(scale+1) ) 
  ratio <- exp( tmp1 + tmp2 ) 
  ratio
 }

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