Skip to main content

Utility functions related to the Cash statistic

Project description

.. image::
:alt: PyPi
.. image::
:alt: MIT
**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.

Files for cashstatistic, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size cashstatistic-0.1.1-py2-none-any.whl (4.9 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size cashstatistic-0.1.1.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page