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
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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0f4e019569851c0965e421ed76131468105389a9134399d1a5dbdfd06f688bf |
|
MD5 | 28ed770dcff4ce263a3da338a05c04a2 |
|
BLAKE2b-256 | c791d0ed88cd1ce8dcdfeea127479c98a7dfc739a57adc25711a09032f1d3187 |
File details
Details for the file cashstatistic-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: cashstatistic-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0b80bede00f122bfc342cfe0feb732e4df197ad6aa155eece5af49c0d9fe23e |
|
MD5 | c4094d87676f68e9a35422b582465cd9 |
|
BLAKE2b-256 | 0f5664e30eedd6e820cc90d7d193bc7b42dd2810cb6e2095dd944a65ae69df26 |