Skip to main content

Tools for bivariate Poisson distribution: density, sampling, MLE, and goodness-of-fit

Project description

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

pip install bivpoispy

Usage

We present some of the function of the package

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]
# Plot the contour distribution of BP(6, 1, 3)
bp.contour(data, lam1=6, lam2 =1, lam3=3)

contour_plot

An introductory notebook with detailed explanation of the functions and examples is available in 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bivpoispy-0.1.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bivpoispy-0.1.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file bivpoispy-0.1.1.tar.gz.

File metadata

  • Download URL: bivpoispy-0.1.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bivpoispy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3bcaf4e496efd68fdf323a41a5d2b0a203dbb7ef149e5f368e5fac25797249c9
MD5 bb566b75938fe75f80fb75438f27f6a7
BLAKE2b-256 f487171a270e4625a6454d0f8cb1bc911314c479b5a5f4830d5b590e184ce36e

See more details on using hashes here.

File details

Details for the file bivpoispy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bivpoispy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bivpoispy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7abb895fcf611ddd622e7f229f20ff798e0ee82eb32121bfb254dfe74fd33643
MD5 4c46a2a9c3975f94de9aace3576e4a3c
BLAKE2b-256 62e9f29be26890dcb1c9fc65b6a64cb032e95b9f6dcb59b9c43636d2cf4dde7e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page