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=True, 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: boolean value indicating if AVX2 instructions should be used during the calculations. Defaults to True,
  • 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 $\frac{1}{2}\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.0.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (113.8 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.0.21-cp311-cp311-macosx_10_15_x86_64.whl (76.4 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.0.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (113.8 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.0.21-cp310-cp310-macosx_10_15_x86_64.whl (76.4 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.0.21-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (113.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.0.21-cp39-cp39-macosx_10_15_x86_64.whl (76.4 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.0.21-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (113.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.0.21-cp38-cp38-macosx_10_15_x86_64.whl (76.4 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.0.21-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (113.7 kB view details)

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

multidimensionalks-0.0.21-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (113.6 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f4420d191877b69724823ab15ab02ab36a667615cd03b339756c74f16283c1a
MD5 56b3f6db24332a433f7c782feaa676eb
BLAKE2b-256 49ccb5d2c410ba330554c822a5dc7995ba0e6e3001fbcebab7b34bec31e4ffab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bc6e29e634efb8a2e4ca6c76f8bdedb397ce1953993a56b9717433f07038ce04
MD5 d95eefdc3c609a997344bf9feca95d8a
BLAKE2b-256 9959805794b81b4d68e35ef2d92c88ecdbb243c0809178625aacedc96c4fd680

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3a9bc5716a1f953e960abd6983646cb23a6b1390122ae68c1963b81f112d2822
MD5 1a0134941278c915ce126b1c80a983ae
BLAKE2b-256 f05e2f0500e085e3c608ae199fba4fd9f326f1fce46203a1a6709b1e1d7f610a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 93cc9ed97717a80ed25c8bd1ae8402d30ef53614fa7fe10dcf918b1db8b85f13
MD5 494f1477661aa000155f4c6cf930fef2
BLAKE2b-256 e9b2d93a2230aa7a90f185aa157571de0df69f607d4da705ec94fa5c9cd8d087

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9addc4c57f4bb57af4c89afba4439500c6e8e1f8be54d4a6da2ea4bedbc8ff77
MD5 73d8332dc88db21d27ffe013ee6873c7
BLAKE2b-256 b4a03da68097c16c77a3d8a1d93b62c66dd5de817dc0d312481355ce092ace6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8773cbac023c23d495113508491a753f22e329f5e2035bbbde339767bd337026
MD5 3c745fb3670cfd8159726ebe34e91f57
BLAKE2b-256 7107585ae97533a18f219ec18bbb8a40f45ff46f92ce62b0929b70b5c22f09ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1812e397ea477ec8909c77ec7fe77da892749355946ce511873919d8c1c133f9
MD5 e87e5aae28b0bb95a6757aec05fe8afc
BLAKE2b-256 154b0778e7f7b5da54aef52bd813a89b71fe877c80b3a026d0a7955c63451db6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d7096ce56792f0cef19ad2daaacb2271191dfd1af8eeb99443bb79f3bd0d222d
MD5 7620c9a13fe7157b60926f931cae91cc
BLAKE2b-256 156a1dc4cfbfb440d3e2e805ca9385e2a196304f664199d2ae22f772cf1373f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 52489ef19847ccb1bf3feec9e2857c5c88381f3487e02b82cbe918f84c53067f
MD5 8acc1451ef62ddcedd435ecd9fff740b
BLAKE2b-256 943ad2a371cd03e60884d8f9f08fccd0e8bf48bc97bf3a55ea2d00f768097acb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.0.21-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1635c2b2b0d187e799f264eb1a76c1b2e958e87d841795670463e2c409425edc
MD5 372296617ede657f3063e79e0f7505c5
BLAKE2b-256 481cf3d4b8d32e7f0fd9818b6c9f343b3141fc709073fcbb5161b26acc3073ef

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