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 .
Note that: \(q_3 < 1\)indicates the negative correlation between \(X\) and \(Y\), while \(q_3 = 1\) indicates the independence between \(X\) and \(Y\).
pgeomBCD()
The function pgeomBCD()
computes the cumulative
distribution:
\[ P(X \leq x, Y \leq y) \]
rpoisBCD()
Generate samples from the BPCD using:
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)
#> $q1
#> [1] 0.270921
#>
#> $q2
#> [1] 0.2251644
#>
#> $q3
#> [1] 0.3809298
#>
#> $logLik
#> [1] -65.99833
#>
#> $AIC
#> [1] 137.9967
#>
#> $BIC
#> [1] 143.7327
#>
#> $convergence
#> [1] 0
For better estimation accuracy and stability, consider increasing the sample size (n = 1000)
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)
#> X Y
#> 1 0 0
#> 2 0 0
#> 3 0 0
#> 4 0 0
#> 5 0 0
#> 6 0 0
table(abortflights$X, abortflights$Y)
#>
#> 0 1 2 3 4
#> 0 34 20 4 6 4
#> 1 17 7 0 0 0
#> 2 6 4 1 0 0
#> 3 0 4 0 0 0
#> 5 2 0 0 0 0
fit <- MLEgeomBCD(abortflights)
FTtest(abortflights, "BGCD", params = fit, num_params = 3)
#> $observed
#> 0 1 2 3 4
#> 0 34 20 4 6 4
#> 1 17 7 0 0 0
#> 2 6 4 1 0 0
#> 3 0 4 0 0 0
#> 4 0 0 0 0 0
#> 5 2 0 0 0 0
#>
#> $expected
#> 0 1 2 3 4
#> 0 36.7576770 16.82940105 7.70529487 3.527848008 1.6152154829
#> 1 15.6134533 5.92019337 2.24477499 0.851157125 0.3227354426
#> 2 6.6320819 2.08258686 0.65396780 0.205357047 0.0644856163
#> 3 2.8170905 0.73260581 0.19051971 0.049546101 0.0128848405
#> 4 1.1966075 0.25771375 0.05550390 0.011953893 0.0025745139
#> 5 0.5082795 0.09065773 0.01616989 0.002884093 0.0005144124
#>
#> $test
#> $test$statistic
#> [1] 49.12544
#>
#> $test$df
#> [1] 26
#>
#> $test$p_value
#> [1] 0.00399207
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.