#######################################################
# 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.