R/dnegbin.r

#######################################################
# Density functions of the sojourn time distributions #
#######################################################

# Density function of the neg. bin. distribution
# ----------------------------------------------
dnegbin <- function(x, r, varpi){
  y <- exp(lgamma(x + r) - lgamma(r) - lgamma(x + 1)) * varpi^r * (1 - varpi)^x
  return(y)
  }

Try the hsmm package in your browser

Any scripts or data that you put into this service are public.

hsmm documentation built on May 2, 2019, 12:32 p.m.