# ============================================================================
# Functions for a Negative Binomial to transform (mean,variance)<->(size,prob)
# ============================================================================
dnbinom.size <- function(mean, var) {
return(mean^2 / (var - mean))
}
dnbinom.prob <- function(mean, var) {
return(mean/var)
}
dnbinom.mean <- function(size, prob) {
return(size/prob - size)
}
dnbinom.var <- function(size, prob) {
return( (size - prob*size) / prob^2 )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.