RBinom: Simulate random number from the binomial distribution.

Description Usage Arguments Value

Description

Generate random integers from the binomial distribution when possible within integer overflow constraints. Otherwise, approximate with the normal distribution.

Usage

1
RBinom(n, size, prob)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

size

number of trials (zero or more). When size is a vector, the number of trials for each observation. Conflicts between the number of observations n and the length of the size vector are resolved by truncating or repeating it to length n. This matches the behavior of the original rbinom().

prob

probability of success on each trial. When prob is a vector, each entry refers to the probability of success for trials associated with the corresponding observation. Conflicts between the number of observations n and the length of the probability vector are resolved by truncating or repeating it to length n. This matches the behavior of the original rbinom().

Value

Random numbers from the binomial distribution, or its normal approximation. The function will return a numeric value, rather than an integer.


google/amss documentation built on May 20, 2019, 5:05 p.m.