Bivariate_LSDsim: Simulates from the bivariate logarithmic series distribution

Description Usage Arguments Details Value Examples

View source: R/SimulateDiscreteDistributions.R

Description

Simulates from the bivariate logarithmic series distribution

Usage

1
Bivariate_LSDsim(N, p1, p2)

Arguments

N

number of data points to be simulated

p1

parameter p_1 of the bivariate logarithmic series distribution

p2

parameter p_2 of the bivariate logarithmic series distribution

Details

The probability mass function of a random vector X=(X_1,X_2)' following the bivariate logarithmic series distribution with parameters 0<p_1, p_2<1 with p:=p_1+p_2<1 is given by

P(X_1=x_1,X_2=x_2)=\frac{Γ(x_1+x_2)}{x_1!x_2!} \frac{p_1^{x_1}p_2^{x_2}}{(-\log(1-p))},

for x_1,x_2=0,1,2,… such that x_1+x_2>0. The simulation proceeds in two steps: First, X_1 is simulated from the modified logarithmic distribution with parameters \tilde p_1=p_1/(1-p_2) and δ_1=\log(1-p_2)/\log(1-p). Then we simulate X_2 conditional on X_1. We note that X_2|X_1=x_1 follows the logarithmic series distribution with parameter p_2 when x_1=0, and the negative binomial distribution with parameters (x_1,p_2) when x_1>0.

Value

An N \times 2 matrix with N simulated values from the bivariate logarithmic series distribution

Examples

1
2
3
4
5
6
set.seed(1)
p1 <- 0.15
p2 <- 0.3
N <- 100
#Simulate N realisations from the bivariate LSD
y <- Bivariate_LSDsim(N, p1, p2)

trawl documentation built on Aug. 16, 2018, 5:04 p.m.