Learn R Programming

BCD (version 0.1.1)

rbinomBCD: Random Sampling from a Bivariate Binomial Distribution via Conditional Specification

Description

Generates random samples from a bivariate binomial conditionals distribution (BBCD).

Usage

rbinomBCD(n, n1, n2, p1, p2, lambda, seed = 123, verbose = TRUE)

Value

A data frame with columns `X` and `Y`, containing the sampled values.

Arguments

n

number of samples to generate.

n1

number of trials for \( X \), must be non-negative.

n2

number of trials for \( Y \), must be non-negative.

p1

base success probability for \( X \), in (0, 1).

p2

base success probability for \( Y \), in (0, 1).

lambda

dependence parameter, must be positive.

seed

seed for random number generation (default = 123).

verbose

logical; if TRUE (default), prints progress updates and a summary.

Examples

Run this code
samples <- rbinomBCD(n = 100, n1 = 10, n2 = 10, p1 = 0.5, p2 = 0.4, lambda = 1.2)
head(samples)

Run the code above in your browser using DataLab