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.1.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.17-cp311-cp311-macosx_10_15_x86_64.whl (227.0 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.1.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.17-cp310-cp310-macosx_10_15_x86_64.whl (227.0 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.1.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.17-cp39-cp39-macosx_10_15_x86_64.whl (226.9 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.1.17-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.17-cp38-cp38-macosx_10_15_x86_64.whl (226.9 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.1.17-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.4 kB view details)

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

multidimensionalks-0.1.17-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.1 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aff69b759bd9d3307a549d1b8146f1bcd2dc412222504e6d8e9ea5c08dab4ef5
MD5 f66086338ae9acf0f77a032ace06d1d3
BLAKE2b-256 bc83187f877a11897847a072ab6f4b2b6ee0c78571e4f5c2a964acf59858cfa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 eb45349cd2a669c7558cf59e10c63cdba77b0490efa3e88dfa755a190a7baa88
MD5 84e3f3e7fbbeaa3df48ff418ce4682b5
BLAKE2b-256 eb2bcfc61ecc75d4928f270ac8d895e3a171bc291d0fc7c1f329f8fc126c1700

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ffeecfc3c8ee3f92776d2565260861d7727d3dc5dbf81c9eaa1c10c59fe9737
MD5 4ef6c3c96dfa8f3d914a1b3d9f96de08
BLAKE2b-256 7ec12681380bc813d1f26000f19f076a39c4f179b7a8762a878d18be1d97f77c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 538ccf95db5fd9799370d5a872349c2e49b270ec2e3da3c67a9122cb16aa4683
MD5 fcd43869f083b352eeae9df9106cede3
BLAKE2b-256 0a12ceaac7e31fd5c1668f81741b9b75212ff04c5f3fff5c62c30dc7170505d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d82b98f0d93a67abe76dff43073d1a3e7c4aae117fd0e2404a224ede9d3cc22f
MD5 3e9693fcd07e999616cbfdd2065dab6e
BLAKE2b-256 8db3b358c0bd3d7544f03b6521d4a7227c95449275993bd84d5f374a31db5276

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1459fb0e49f9d12ea0baf6656daa1aa4d009b8f1cb6bf24c805c671bfdcd02aa
MD5 81d9e25af5d72a7a52cbde1469704058
BLAKE2b-256 e961b61cbbdad14368b10b884b763c75cea75783f8b45ca104aba846a14fe35c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65b99c120efb22430929c72aa384908c71dd9559c09fe96a5f0f86c1fa8d1477
MD5 c4fce5702c41209bf91004d19e30fe49
BLAKE2b-256 ab01deade0eb60612aade23bd26926bfa60fbad32653e678b3ef68bb97e020f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3d05d0b3783500f0d3f1fb84eea31e4f9eda77314a980f8e3804c965ab8fa4f9
MD5 93779710bcdd85aed8ef71b4e9dae331
BLAKE2b-256 cfbd675e87013059070c790d888941771c3a97822a644d554cf63db6813fda1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c37002301525cfce0514b49ac4bba859d5b239afc5527eedb5a0f23bdf8eb7df
MD5 92e1530b0388bf6a771d8cd7bf6bb951
BLAKE2b-256 a6721c977d574a3a1d8f1b8a7df4f47b8bdcba2a421696430bde59d1d063f1d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.17-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb456acbdb1dfcabcb8a389409c03b0baef8cfd09821a989db85de5c7b8fc839
MD5 77f6412c629081780659e3cc166c783c
BLAKE2b-256 3b35263c80e34d897e44c7247acf305d2b543587044303293837963180f950b4

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