rbinomBCD: Random Sampling from a Bivariate Binomial Distribution via...

View source: R/rbinomBCD.R

rbinomBCDR Documentation

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)

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.

Value

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

Examples

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


BCD documentation built on June 25, 2025, 5:09 p.m.