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

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.14-cp311-cp311-macosx_10_15_x86_64.whl (229.6 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (330.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.14-cp310-cp310-macosx_10_15_x86_64.whl (229.6 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (330.9 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.14-cp39-cp39-macosx_10_15_x86_64.whl (229.6 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.1.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (330.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.14-cp38-cp38-macosx_10_15_x86_64.whl (229.6 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.1.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (330.3 kB view details)

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

multidimensionalks-0.1.14-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (330.1 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 89c9d37b74d85c7d8bbe315b9920627118c959ee29b22f6f49cb6dd484cf6903
MD5 16d124e2edb2fb25ea016b91ec1dd369
BLAKE2b-256 1de777a747c21d9abac35d7a03533990288f90f3a21bca9c66f14094e44ebd30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 260638224e257d5a9ec7dfbbc59ee205478da2d6fc83d1566dfa2e4f01321cf0
MD5 f6ed2dc57be4265108a8529745ddde00
BLAKE2b-256 2100b064670ffecddcae5682638a83dd2a80ec35f63ef2955e3028ce7172f87b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6470ad30ec262a543d3a78c7cd5c4fdec86f729713e8c74928749ca9f20563c1
MD5 e4a6829e33bae9def67fa17ca4f83ccd
BLAKE2b-256 3ed00c70c2426e6befcfc03acbdac4a7628837a3d9bce99d24afe1ae04f8cb3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a42eb959d449668bfd49978d807a0e3b8a019d9a06b11d766d5f96353e74d573
MD5 a181826d0fd71ebc2995ff4fcf7a901a
BLAKE2b-256 1dc75a1669f32326f5c91ef0ae47946369ffad24a43ba85a291bd106eab7b459

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95d3c15cf699714068bc57e7c3e4c497eb492d51458dc5ccf5568183186814c7
MD5 9dd3b0b83a58c348d79a870281736542
BLAKE2b-256 4a1372a5c356f4e911f2a394853d0821bc5a1c078f9bf67c58a7accab119a2ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 57dfd0f8b5f35e1b7cad870070d408f431361b1e1efba7f19c9e25c48d178abe
MD5 0511eb2d2bd21955da4de157622b3656
BLAKE2b-256 dc614514cd31b1043b609450c79209ab4ca2e95843971248d2adf16a15a83e34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2e66d5f1d8004b261ed9890926007423a98b8aad8a3e06318d003e1b94009606
MD5 90de109b82bd7d0aa02f2e4fa64c3a45
BLAKE2b-256 f547ac16e8f12b2386c8c57b04801d362136e11bf9d2e496393edd53686a78ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2da5a031873eb779f15f8ef7e303dd3cc8acf0d8e982be188b0a392e64005344
MD5 3fea611ce75cb10977b144c3508b1e40
BLAKE2b-256 a76f08229b75d081d623de7e828ef1f2ffcd52d4804be3fb52eb44e1132f6f45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 af48b71877137bf7f78ecec0b0b28bcb90245faf8ffac91e9eb7ae479dc11fda
MD5 ba60ec4b87de0c1decf2cd0c905a8798
BLAKE2b-256 f2b29195be8f041d899abc44081b07f4b9bdfbf561b701643ba51e0a6d9ef019

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.14-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a70dcde632e5a96371ec57aa3fdb5e5f65e10869d2dc06aa17c9f68a3035113f
MD5 b6fd23c4d27046ac9b851ed8d9d38c35
BLAKE2b-256 f2c7e8ec810251f066c4f28b1005726493303f30972d44deebd5eb0f0e6ff452

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