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=3, max_alpha_beta=True, scale_result=False, 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 disables avx, 3 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. Defaults to 3,
  • max_alpha_beta: boolean value indicating how λ and β values should be combined. Value True (default) results in max(λ, β). (λ+β)/2 is used otherwise.
  • scale_result: Whether to scale the statistic by $\sqrt{\frac{|rvs|+|cdf|}{|rvs|\times|cdf|}}$ (default False),
  • 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.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.6-cp311-cp311-macosx_10_15_x86_64.whl (230.6 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.3 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.6-cp310-cp310-macosx_10_15_x86_64.whl (230.6 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.6-cp39-cp39-macosx_10_15_x86_64.whl (230.6 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.2.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.6-cp38-cp38-macosx_10_15_x86_64.whl (230.7 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.2.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.9 kB view details)

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

multidimensionalks-0.2.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.7 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 10789838bb04ec7b0c677d5c164ea53d95f49b48017204bbdf7e1557b3309957
MD5 d42a86b79b7f33ec6060d225e97707ba
BLAKE2b-256 85d017f5a20eb3b640205632c9acfb072f90e821d7919ce0ed7388434b6d623a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7bca91817429e1aae51f06b6acbec81932b85daf86b07d74ca0b3e7c831d7e56
MD5 fc86e5d0b4ce2e9069be7868cd9d271c
BLAKE2b-256 e5134dedb03ece3161e50a647591215cab4501e96c49200218bc7a5f23bbec5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cdfeb11410a9ce387e188738159dd108ae4155670464fe8648870d4ea90fbfa8
MD5 e60a41d8eab4c2d663447da702829d02
BLAKE2b-256 95005e7ac1773d19c02a0e45028bb38f2a3138e37126e819f15c378a9e3d0506

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 367e72c55dbdf0daf77b627ca65c620356e0efc43ed969b4694a0a340ffcd124
MD5 3155e7efba0bca3534018e2efc121fc6
BLAKE2b-256 400d5f47781aecb3dd0d3729a219730c4be31341e9351fe0f99e7eba61ad62e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 081946cacae0e3def1dba2eccf090a8792b930b556d640bf224362214bf3efd1
MD5 1c6ffbdd3de5742e7066ac83433f4e2a
BLAKE2b-256 3477af9a7bc324aba701e9bd7c68110860602fc34981187c761d431dd024508f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 058d4f796124ff8e7f039ef45e3c4ec68d70f1fc1e65490f04bc0537f5a6a70e
MD5 3104580cb43da45bdeaf9993bf406059
BLAKE2b-256 8dfa8ebfc1a6d7a63c64e83b38f859629eaab512ace769a2acff46af9f04bb21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa7c5f4588305291382829a1f8d26599701b7cb4d342c0f323ed1ab7955a1e69
MD5 36658178631544aa455ed26e0abdba0b
BLAKE2b-256 f3bfc6145bb32d5a3bce69c504736990fce405dd3749b9b6b9874ebf514b2c90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 49e14089a027f87dab14e4f4e2934bedb279d3dc4f14ba154e0c09bb39735bfc
MD5 bcd0bf5734945c994d680de1a18f7da7
BLAKE2b-256 aa89f5e5a415b55bc1b22641db95f3115828fe3f2a8d9f9f0d57e596d600ece3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa56120783640b511dc88e49d2e073f72ce6447baf6173ab8559e041ede27ab8
MD5 391d92f35c1112426547a3ec930f14ea
BLAKE2b-256 a4bb6ad3ef2ea7342dea92b779a008d562cce63b49853440f03eae8b00a993f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0f65bb556b27a99c2f461b1d4c18145a782c60a3c04d6f847c7c45d0df6f1ad7
MD5 974902d2683f5b781c1f0c66513d0d30
BLAKE2b-256 768d7101da32a11a230cf0d8a7d113477fb4e492ce1c8be12e8eaa9336c3c9bb

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