Skip to main content
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.

Metadata

Release files for cashstatistic 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cashstatistic 0.1.3
File Size Uploaded
cashstatistic-0.1.3.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cashstatistic 0.1.3
File Interpreter ABI Platform
cashstatistic-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / cashstatistic-0.1.3.tar.gz

Download URL cashstatistic-0.1.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f0f4e019569851c0965e421ed76131468105389a9134399d1a5dbdfd06f688bf
BLAKE2b-256 checksum
How to use checksums
c791d0ed88cd1ce8dcdfeea127479c98a7dfc739a57adc25711a09032f1d3187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.5

Release files / cashstatistic-0.1.3-py3-none-any.whl

Download URL cashstatistic-0.1.3-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0b80bede00f122bfc342cfe0feb732e4df197ad6aa155eece5af49c0d9fe23e
BLAKE2b-256 checksum
How to use checksums
0f5664e30eedd6e820cc90d7d193bc7b42dd2810cb6e2095dd944a65ae69df26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page