Utility functions related to the Cash statistic
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cashstatistic-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be941fe0b3974dd5467fef19b79f66349db035ccfe382d81fa002570ebb4e12b |
|
MD5 | b5dd859084bed3aafc5ba77bb146e94a |
|
BLAKE2-256 | 8fec4cade4ddb99222ad57fb3cb3611ffb35cdaea850fbe721027e1ce614e63d |