Skip to main content

Multidimensional KS test module in python

Project description

multidimensionalks

Python c extension with method for calculating multidimensional Kolmogorov-Smirnov test

multidimensionalks.test(rvs, cdf=None, counts_rvs=None, counts_cdf=None, n_jobs=1, permutation_samples=0, binomial_significance=False, use_avx=1, max_alpha_beta=False, scale_result=True, deduplicate_data=True, debug=False)

Example usage

from multidimensionalks import test
import numpy as np

test(np.array([[1, 2, 3], [1, 3, 2]]), cdf=np.array([[1,2,2]]))

Parameters

  • rvs: 2-dimensional numpy number array with rows representing d-dimensional observations,
  • cdf: 2-dimensional numpy number array with rows representing second sampled-dimensional observations,
  • counts_rvs: in case of rvs having multiple duplicates, an array without duplicates and a separate array of counts can be provided,
  • counts_cdf: in case of cdf having multiple duplicates, an array without duplicates and a separate array of counts can be provided, additionally if cdf is not given counts_cdf are taken as counts of elements of rvs array,
  • n_jobs: number of threads used during calculation,
  • permutation_samples: number of times data is shuffled and the statistic value is calculated to estimate pvalue,
  • binomial_significance: boolean value indicating if statistical significance should be calculated. Defaults to False,
  • use_avx: integer value indicating if AVX instructions should be used during the calculations. 0 means to try the best supported set, 1 will try to use AVX512 instruction set and use no otherwise, 2 will try to use AVX2. -1 will disable avx. Defaults to 0,
  • max_alpha_beta: boolean value indicating how λ and β values should be combined. Value True results in max(λ, β). λ+β is used otherwise.
  • scale_result: Whether to scale the statistic by $\sqrt{\frac{|rvs|+|cdf|}{|rvs|\times|cdf|}}$,
  • deduplicate_data: Whether to deduplicate data points before running the algorithms,
  • debug: Whether to print debug data to stdout.

Return value

If no pvalue calculation method is selected returns ks statistic value, otherwise returns a tuple:

  • ks statistic,
  • pvalue calculated using statistical method if binomial_significance is set to True,
  • pvalue calculated using permutation method if permutation_samples is larger than 0.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

multidimensionalks-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl (222.5 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl (222.5 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl (222.5 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl (222.4 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.3 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.2 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

File details

Details for the file multidimensionalks-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e2526502de578d7ab5b26e9f36e0160a4a3be23179d2beaa9cdc6e645021489b
MD5 2f92266cf06e738c2d47fd643b260647
BLAKE2b-256 f9a20e5a926a20a99d187e331eaba500c185ff945620c67c6aafb5e4ae9cf016

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 35995a2e6ee46347778b11be26a7072b63653483d57e2c2b15a6ee620a00f97c
MD5 626647d4ec11f5338515e32becfb268a
BLAKE2b-256 8933c48170bd0668f192465d6b7244f66b83cd584b5c66cc8d63460c2e5678a3

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86c8b9bc3b3633dfaa559b91c93e3d613d6f446984af5936a0a7bc0fc4415f37
MD5 05c32f8bdc229008023a65616cc694f9
BLAKE2b-256 30277573d34468ebcda9e093ca7a18b4ca22ad0ee69dd0785fb1ff0863d23d6b

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c2309ea068d1a77c0305005f45251dd4ebca7d5c5a88dee27bed636a2d5bfc62
MD5 cfe41a5e6b3d52366a79401b75da9cc0
BLAKE2b-256 6adcff1fe45bd799b65a4ad4529b0273f2a80b245c8945a197f4a71833d13485

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e58cb9f0bfae1e3bf5983466161e1e44da2bbfda6c87c8469fd976b01a4e46a0
MD5 6ba705de8dd056d57019503fada921f7
BLAKE2b-256 5871efca8b68e4f059595e41c1afa459ffe52a789015a4caa020fe5baad47806

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 76732c51c8c6ea0e4a16bb142403f1139c0c76eac7c892a01f7a1ab404c1a93b
MD5 b74b2e7deddebb18ae0f540d73799794
BLAKE2b-256 6f6a42c034514981308935c4c02cc7be976d55b7166d7fe6223ae7ea15ced363

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c7fb4948dc97f9252539352151a7ca7d1132d7e80bf4e742fde307436c5b8952
MD5 f64d05c24e72f55e559c93efa9042c58
BLAKE2b-256 3ab0ffaaab68fde7ad3e121d2a53cd5188267fc85758a2bbd446139d5e293db0

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ae679fc2bfde261ebb756d2423298f8aed1bb161630e2ee1321fc64b24abae77
MD5 0b2d66101ae8cd8f1918819525b8c541
BLAKE2b-256 9923f71895f6a8eb2e6dea3d1c43bc94f24b980680113a0a735fa30bb85c5702

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81dcec4c8b76a882218bdc3608acbb543cf4e9711710eed6443d37933e932eb9
MD5 d8849233d742e32a847ed0722370313b
BLAKE2b-256 6b3f74d50e8dd0e7cc25684fa9e09f31e5a4b860e3d35814d5cf166f02f6f719

See more details on using hashes here.

File details

Details for the file multidimensionalks-0.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for multidimensionalks-0.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6b1de21b26af7e20b758d398143fd04ba9dff248991e8bbce5a8c55d3155850
MD5 376013398647123bc0a83f8444a79905
BLAKE2b-256 fbc2984a0c1ea3a3fc27200dd60036c61d412ca67a29437237d09f6e1e39e3b5

See more details on using hashes here.

Supported by

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