Skip to content

Commit

Permalink
Added output documentation for pNextGenSize #6
Browse files Browse the repository at this point in the history
  • Loading branch information
damontoth committed Nov 15, 2024
1 parent 3f948db commit c5268d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/pNextGenSize.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#' @param y number of total transmissions in generation n+1
#' @param R mean of negative binomial offspring distribution
#' @param k dispersion of negative binomial offspring distribution
#'
#' @returns The probability of the given number of transmissions
#' @examples
#' # With 5 individuals in this generation, what is the probability of
#' # 0 to 15 transmissions in the next generation?
#' pNextGenSize(5, 0:15, R=0.2, k=0.1)
#' pNextGenSize(x=5, y=0:15, R=0.2, k=0.1)
#' @export
pNextGenSize <- function(x,y,R,k) exp(lgamma(k*x+y)-lgamma(k*x)-lgamma(y+1)+y*log(R/k)-(k*x+y)*log(1+R/k))
5 changes: 4 additions & 1 deletion man/pNextGenSize.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5268d4

Please sign in to comment.