Metadata-Version: 2.4
Name: bivpoispy
Version: 0.1.1
Summary: Tools for bivariate Poisson distribution: density, sampling, MLE, and goodness-of-fit
Author-email: Ilyan Alexey Cortés Miranda <alexey.cortes13@gmail.com>
License-Expression: MIT
Project-URL: Repository, https://github.com/alexcom13/bivpoispy
Keywords: bivpois,bivariate poisson
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20
Requires-Dist: scipy>=1.7
Requires-Dist: matplotlib>=3.5
Requires-Dist: numdifftools>=0.9
Dynamic: license-file

# bivpoispy

## Highlights 

- Easy way of handle two dimensional count values.
- Shows contour and likelihood profile plots.
- Bivariate Poisson regression soon ... 

## Overview

Bivariate Poisson distribution for Python. Utilities for density evaluation, random sampling, maximum likelihood estimation, goodness-of-fit testing, and visualization.

## Installation
 
```bash
pip install bivpoispy
```

## Usage

We present some of the function of the package 

```python
import bivpoispy as bp
import numpy as np
 
# Simulate data from BP(6, 1, 3)
data = bp.random(lam1=6, lam2=1, lam3=3, size=1000)
 
# Compute the ML estimators and confidence intervals
result = bp.mle(data)
print(result)
```
 
```
lambda: [6.316995621845176, 1.1619956218451764, 2.8510043781548235]
rho: 0.4700304589772127
observed ci: [2.5932249797302585, 3.1087837765793886]
asymptotic ci: [2.5763621899957716, 3.1256465663138755]
loglik: [-4629.4336004690895, -4500.3484671610495]
pvalues: [4.29892277253514e-58, 1.6936755393462774e-104, 2.5194599844374772e-92]
```

```python
# Plot the contour distribution of BP(6, 1, 3)
bp.contour(data, lam1=6, lam2 =1, lam3=3)
```
![contour_plot](contour_plot.png)

An introductory notebook with detailed explanation of the functions and examples is available in [`examples/bivpoispy_intro.ipynb`](examples/bivpoispy_intro.ipynb).


## References
 
- Kawamura K. (1984). Direct calculation of maximum likelihood estimator for the bivariate Poisson distribution. *Kodai Mathematical Journal*, 7(2): 211–221.
- Kocherlakota S. and Kocherlakota K. (1998). *Bivariate discrete distributions*. Wiley Online Library.
- Karlis D. and Ntzoufras I. (2003). Analysis of sports data by using bivariate Poisson models. *Journal of the Royal Statistical Society: Series D*, 52(3): 381–393.
- Lakshminarayana J., Pandit S. N. N., and Srinivasa Rao K. (1999). On a bivariate Poisson distribution
