TABLE OF CONTENTS


simSurvival/dnegbin [ Functions ]

NAME

    dnegbin --- negative binomial distribution

FUNCTION

Compute the negative binomial distribution function. This is for use as a prior on the number of knots for adaptive selection.

SYNOPSIS

1135 dnegbin <- function(x, r, p) 

INPUTS

    x  the values at which the distribution should be computed
    r  number of trials
    p  probability of success

OUTPUTS

    The NB(r,p) distribution evaluated at x

SOURCE

1138 {
1139     out <- gamma(x + r) / factorial(x) / gamma(r) * p^r * (1 - p)^x
1140     out
1141 }