Learn R Programming

BCD (version 0.1.1)

rpoisBCD: Random Sampling from a Bivariate Poisson Distribution via Conditional Specification

Description

Generates random samples from a bivariate Poisson distribution (BPD).

Usage

rpoisBCD(n, lambda1, lambda2, lambda3, seed = 123)

Value

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

Arguments

n

number of samples to generate

lambda1

rate parameter for \( X \) that must be positive

lambda2

rate parameter for \( Y \) that must be positive

lambda3

dependence parameter that must be (0, 1]

seed

seed for random number generation (default = 123)

Examples

Run this code
samples <- rpoisBCD(n = 100, lambda1 = 0.5, lambda2 = 0.5, lambda3 = 0.5)
cor(samples$X, samples$Y) # Should be negative

Run the code above in your browser using DataLab