Skip to main content

Utility functions related to the Cash statistic

Project description

PyPi MIT

cashstatistic

Utility functions related to the Cash statistic

The Poisson distribution is

P(x|mu) = exp(-mu) mu^x / x!

The Cash statistic is defined to be the model (mu) dependent part of -2ln(P), analogous to the role that chi^2 plays for the Gaussian distribution,

C = 2( mu - x*ln(mu) ).

A modified version,

C_m = 2( mu - x + x*ln(x/mu) ),

is equivalent to C for parameter inference (i.e. has the same dependence on mu), and also has the nice property of becoming equivalent to chi^2 when x is large. Kaastra (2017) was kind enough to provide approximate expressions for the mean and variance of C_m, which can be used to determine whether the actual C_m corresponding to a fitted model is indicative of a good fit (just as chi^2 does for the Gaussian distribution).

This package contains python code to calculate C, C_m, and the theoretical mean and variance of C_m. The GitHub repo contains implementations in other languages.

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

cashstatistic-0.1.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

cashstatistic-0.1.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file cashstatistic-0.1.3.tar.gz.

File metadata

  • Download URL: cashstatistic-0.1.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for cashstatistic-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f0f4e019569851c0965e421ed76131468105389a9134399d1a5dbdfd06f688bf
MD5 28ed770dcff4ce263a3da338a05c04a2
BLAKE2b-256 c791d0ed88cd1ce8dcdfeea127479c98a7dfc739a57adc25711a09032f1d3187

See more details on using hashes here.

File details

Details for the file cashstatistic-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cashstatistic-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0b80bede00f122bfc342cfe0feb732e4df197ad6aa155eece5af49c0d9fe23e
MD5 c4094d87676f68e9a35422b582465cd9
BLAKE2b-256 0f5664e30eedd6e820cc90d7d193bc7b42dd2810cb6e2095dd944a65ae69df26

See more details on using hashes here.

Supported by

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