Skip to main content

spacings

This python package implements several test statistics based on spacings, i.e. the spaces between ordered samples. The API is similar to scipy's tests, such as the kstest.

Installation

pip install spacings

Usage Example

import numpy as np
from spacings import rps, moran
from scipy.stats import kstest, cramervonmises

Generate random samples

rand = np.random.RandomState(0)
uniform = rand.rand(100)
  • RPS test:
>>> rps(uniform, "uniform")
RPStestResult(statistic=0.9861622857523498, pvalue=0.6747286655166371)
  • Moran test:
>>> moran(uniform, "uniform")
MorantestResult(statistic=525.7712608675467, pvalue=0.3920410695917047)
  • KS test (scipy):
>>> kstest(uniform, "uniform")
KstestResult(statistic=0.0736727958814345, pvalue=0.6226614157861845)
  • Cramer von Mises test (scipy):
>>> cramervonmises(uniform, "uniform")
CramerVonMisesResult(statistic=0.1203440927515015, pvalue=0.4947678804693505)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacings-0.0.5.tar.gz (4.2 MB view details)

Uploaded Source

File details

Details for the file spacings-0.0.5.tar.gz.

File metadata

  • Download URL: spacings-0.0.5.tar.gz
  • Upload date:
  • Size: 4.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.2

File hashes

Hashes for spacings-0.0.5.tar.gz
Algorithm Hash digest
SHA256 86841c32ad032681bf529388f54cb3acdf8564e32703be1c300683bb195883af
MD5 c6025f9d8c9b1d6b668f67995280932f
BLAKE2b-256 68900c162636e0ac462b73f4802cad93ad253e34dcd84805e6ca799f838bf69c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

0.0.0

1 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