knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(BCD)
This vignette introduces the Bivariate Geometric Conditionals Distribution (BGCD), defined via conditional specifications, as proposed by Ghosh, Marques, and Chakraborty (2023). The BCD
package provides functions to evaluate the joint and cumulative distributions, perform random sampling, and estimate parameters via maximum likelihood.
dgeomBCD()
The joint probability mass function (p.m.f.) of the BBCD is given by:
[ P(X = x, Y = y) = K q_1^x q_2^y q_3^{xy}, ]
where ( K ) is a normalizing constant ensuring the probabilities sum to 1 and \eqn{ x, y = 0, 1, 2, \ldots }.
Note that: $q_3 < 1$indicates the negative correlation between $X$ and $Y$, while $q_3 = 1$ indicates the independence between $X$ and $Y$.
dgeomBCD(x = 1, y = 2, q1 = 0.5, q2 = 0.6, q3 = 0.8) dgeomBCD(x = 0, y = 4, q1 = 0.5, q2 = 0.6, q3 = 0.8)
pgeomBCD()
The function pgeomBCD()
computes the cumulative distribution:
[ P(X \leq x, Y \leq y) ]
pgeomBCD(x = 1, y = 2, q1 = 0.5, q2 = 0.6, q3 = 0.8) pgeomBCD(x = 0, y = 0, q1 = 0.4, q2 = 0.3, q3 = 0.9)
rpoisBCD()
Generate samples from the BPCD using:
rgeomBCD(n, q1, q2, q3)
set.seed(123) samples <- rgeomBCD(n = 100, q1 = 0.5, q2 = 0.5, q3 = 0.1) head(samples) cor(samples$X, samples$Y) # Should be negative
MLEgeomBCD()
Estimate the parameters of the distribution from data.
samples <- rgeomBCD(n = 50, q1 = 0.2, q2 = 0.2, q3 = 0.5) result <-MLEgeomBCD(samples) print(result)
For better estimation accuracy and stability, consider increasing the sample size (n = 1000)
samples <- rgeomBCD(n = 1000, q1 = 0.2, q2 = 0.2, q3 = 0.5) result <-MLEgeomBCD(samples) print(result)
The dataset abortflights
records the number of aborted flights by 109 aircrafts
during two consecutive periods. The counts are cross-tabulated by the number of
aborted flights in each period.
data(abortflights) head(abortflights) table(abortflights$X, abortflights$Y)
fit <- MLEgeomBCD(abortflights) FTtest(abortflights, "BGCD", params = fit, num_params = 3)
Reference: Ghosh, I., Marques, F., & Chakraborty, S.(2023) A bivariate geometric distribution via conditional specification: properties and applications, Communications in Statistics - Simulation and Computation, 52:12, 5925--5945.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.