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 disables av, 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.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.4-cp311-cp311-macosx_10_15_x86_64.whl (223.4 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.4-cp310-cp310-macosx_10_15_x86_64.whl (223.4 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.4-cp39-cp39-macosx_10_15_x86_64.whl (223.4 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.4-cp38-cp38-macosx_10_15_x86_64.whl (223.4 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.2.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.5 kB view details)

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

multidimensionalks-0.2.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (323.4 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c218d0e48359f80315efe156cd8cd98616a5f6d93fb3ab7fccc6188c30695a3b
MD5 4e372093c02106b9154b54f301b8e369
BLAKE2b-256 6ffd011f1464523f5b549ddcb4f97e7b026bf89ea35f1f2c16be1797b47694e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 773cd2e1566a91886c3dfaecdb69b236989bf6a3f5d9b4d1110b60bf9762214b
MD5 abb47eed09ebb457d14ed6af41347842
BLAKE2b-256 f95ff27a107638ad0167b3c5da76d748ea7017a2c77ea92108e502785ab66b22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3ca4e600fe371bedeaf4790c0f6e4233e4c3053c87c0593175202c5476ebd93
MD5 143f94a66e8bf3301acbb014d863f96e
BLAKE2b-256 fdb69827262150a2d1c499bd4c07e2504042a25e60539fc3c170ab17ba61592e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5f9eba7fb153eba498005e2adc5d029326aeb6771280cf5f68471b19855ef06a
MD5 886c2c8d6e48b6d75c644cc6ee1f87ee
BLAKE2b-256 4c8484b44ddae1b39f16e062bed06500477c3ee75df94660a253ecde37c31e27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ffc3b9011654347741ea3516b7de4fd2057c121640cc4b9e295d3497021a74d6
MD5 fe30b0aaf29e49e1f5bd4d828bdef085
BLAKE2b-256 478ee2429fe56fecb3f254efa3d009914f5dc6ed7ffe8914b70bc43da768fbda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7389d58021515da81bc60b6067e66ec2aa278e6d5d51348a41f61a0967b1704e
MD5 7ff9aef6e5383790f19bf838a369bfd9
BLAKE2b-256 4a97bf536a5fc57410f9d411547e62fadd3e2e88d58da96bf5db15129b31d08a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ee7ada89bd1c6a552740a95bb19e37b11e74e2f80e9af5fb2c28b07cf42fa87
MD5 63b20f7faedd7418c9bac7b80f9fa226
BLAKE2b-256 97426599ae8e6e2bf4c2dd4d6ea5df51b28c30c2e4aedae80f828e3e2bf2dbc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 78e22edf904a285b628a5bbc331f9fd7a348cb26d6b2ffa1172d85ee4778e540
MD5 6acdd24a90d6f5d4bee14a9aca17e9b8
BLAKE2b-256 1c9092f793cb55fd94f1085e44604945ec73cd4106a8b44c835a8a74201261c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6fe43b28d5702d2dc735480a3285b6364de091f50be6cbdea38332f486703ed
MD5 2dc6f3cf2d75ccb4096ed43e035734d0
BLAKE2b-256 4a4e7ff154734ea676abc99b58cee5288f2f65a1503a715197e03cfb2d1904ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ed73c17c37d1eb219dbad05613d02c1c45e06f272d336e21def5fa4b2a48eda8
MD5 20befbea60c583cd2c872a6cc9467a75
BLAKE2b-256 b91a48130760bf8064b44dbb2084ba4337f8d265ce2b5975e022c6cffe7f4a3c

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