This function obtains moment estimators for the Bivariate Poisson distribution under the parameterization of Lakshminarayana et. al (1993).

moments_estim_BP_Laksh(x)

Arguments

x

vector or matrix of quantiles. When x is a matrix, each row is taken to be a quantile and columns correspond to the number of dimensions p.

Value

Returns a vector with \(\hat{\lambda_1}\), \(\hat{\lambda_2}\) and \(\hat{\alpha}\).

References

Lakshminarayana, J., Pandit, S. N., & Srinivasa Rao, K. (1999). On a bivariate Poisson distribution. Communications in Statistics-Theory and Methods, 28(2), 267-276.

Author

Freddy Hernandez-Barajas, fhernanb@unal.edu.co

Examples

# Generating random values and moment estimations
l1 <- 1
l2 <- 2
alpha <- -2.7
x <- rBP_Laksh(n=500, l1, l2, alpha)

moments_estim_BP_Laksh(x)
#>        l1_hat        l2_hat alpha_hat_cor 
#>        0.9880        2.0460       -2.4809 

# Analizing example from Famoye (2010)

freq <- c(34, 20, 4, 6, 4,
          17, 7, 0, 0, 0,
          6, 4, 1, 0, 0,
          0, 4, 0, 0, 0,
          0, 0, 0, 0, 0,
          2, 0, 0, 0, 0)

data_table <- matrix(freq, ncol=5, byrow=TRUE)
rownames(data_table) <- 0:5
colnames(data_table) <- 0:4

data_table
#>    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

long <- as.data.frame.table(data_table)
x <- long[rep(1:nrow(long), long$Freq), -3]
x <- data.matrix(x)

colMeans(x)
#>     Var1     Var2 
#> 1.623853 1.724771 
var(x)
#>           Var1      Var2
#> Var1  1.033129 -0.169300
#> Var2 -0.169300  1.071696
cor(x)
#>            Var1       Var2
#> Var1  1.0000000 -0.1608955
#> Var2 -0.1608955  1.0000000
moments_estim_BP_Laksh(x)
#>        l1_hat        l2_hat alpha_hat_cor 
#>        1.6239        1.7248       -1.9980