View source: R/betafunctions.R
rGammaBinom | R Documentation |
Random number generation under the Gamma-extended Binomial distribution.
rGammaBinom(n, size, prob, precision = 1e-04)
n |
Number of observations. |
size |
Number of "trials" (zero or more). Need not be integer. |
prob |
Probability of "success" on each "trial". Need not be integer. |
precision |
The precision with which the quantile is to be calculated. Default is 1e-4 (i.e., search terminates when there is no registered change in estimate at the fourth decimal). Tuning this value will impact the time it takes for the search algorithm to arrive at an estimate. |
Calls qGammaBinom()
, which makes the random draw slower than what one might be used to (since qGammaBinom()
calls pGammaBinom()
and employs a search-algorithm to find the appropriate value down to a specifiable level of precision).
# Assume some variable follows a Gamma-Binomial distribution with
# "number of trials" = 10.5 and probability of "success" for each "trial"
# = 0.75 To draw a random value from this distribution:
rGammaBinom(n = 1, size = 10, prob = 0.75)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.