rvbern: Sample a vector of Bernoulli variables.

Description Usage Arguments Value

View source: R/utils.R

Description

Sample a vector of Bernoulli variables with higher speed (same length with "p"). The Bernoulli random variables can have different means.

Usage

1
rvbern(p)

Arguments

p

A vector of probabilities, each being the head probability of an independent coin toss

Value

A vector of 1s (head) and 0s (tail)


zhenkewu/nplcm documentation built on May 4, 2019, 10:19 p.m.