Skip to main content

Spacings

Project description

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(np.random.rand(100), "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)

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

spacings-0.0.4.tar.gz (218.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: spacings-0.0.4.tar.gz
  • Upload date:
  • Size: 218.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.2

File hashes

Hashes for spacings-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6733e6512656762b06c6cdab086fe67487c52ba70f05b5698477bb44c691c9f3
MD5 0b89ecbe6810447c233e0279a0b36ac4
BLAKE2b-256 6cafbee5308b44879f2b8423c5ced670bbab101e0db9b658ffa97245289a40ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page