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

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.16-cp311-cp311-macosx_10_15_x86_64.whl (226.7 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.1.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.16-cp310-cp310-macosx_10_15_x86_64.whl (226.7 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.1.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.16-cp39-cp39-macosx_10_15_x86_64.whl (226.7 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.1.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.1.16-cp38-cp38-macosx_10_15_x86_64.whl (226.7 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.1.16-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (328.0 kB view details)

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

multidimensionalks-0.1.16-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (327.7 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4b038e1985ac09aacd96ab6e30f332662463962dc795d4395be785ec0f44cf0
MD5 8a5043d1ec1aa50b901ceca836e99209
BLAKE2b-256 1e987218441a864a6e5806fd38258b7d558039fe43c3fcc814d6c50ed0a54aa3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 643b6edef933089129e56d2eb8fb63dc43bd56083294bac3e152383c1e4981b2
MD5 5de94b7c511f9995164d53bd1e695edb
BLAKE2b-256 3fdb617d27664511a6180ed55eded66c5bb23e37b92d143fe9c362ede3de9c03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 67e1f9feea01ddb4625af54e66f76a3a296123f73a5e10863c017281457a20fb
MD5 9a3f5bd70bcc848c697debd0af22a738
BLAKE2b-256 a93b05c272143ec1110b6f14f39923c8603cddfdafe37ab2788946ccba397612

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a1cba2a3e1bcc1af0222f67ea281c68470f29bb82d8fc9fe0641868e13206ab8
MD5 ce405b367156217da5eb51678293d13a
BLAKE2b-256 387ddc468f1a490592b04b33d0b4ebd8d0be66f905b9b9baa5816a833a297238

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 28159c615546760d3fc8bceb7ee3e6f374169c3021d03e2281ffbf8c88232def
MD5 1a455dba0b80a64cbeadda029379c93e
BLAKE2b-256 2f0f50a3ef7b567f360077514199b7bc1a7621aa6ef02568e340c8fbbe41222a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 179abbd27edc267b3bec402fb0b003c459175093a9b539e4374cb3b1dbf12c17
MD5 4a80bd1c6e5e4af16156bed187a0f127
BLAKE2b-256 285c8f608e7b63d59a28e958671e334821a6d6d8cca17ff7df40d245d8d865f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c274f4e75538d70ed78ab30e0a8f9ef23e106fa2dbf00d7d8d85f72f0392b91e
MD5 8e003d106d28348a354ae020b3a22b38
BLAKE2b-256 59c6a36feca945ea015b371a3a2ce66602f017c59f2228f387ee01dbae1237dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4d0e5fa1acf25ed953f5c0acf691f7daac39fee4899edcd7a108dae8e75ece1f
MD5 2b7328913a111b9f8f2be33e99fc07c0
BLAKE2b-256 3c5425883179765b73ca5372adb050de07a303e1bd55a96720e7a7e6c978a60a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2a25958eeabccb12e4176bcc9a5b90468fdc6c4ccf6e4edd51fdb812640d8655
MD5 ae40f9171cab091d70419716d9bd8bc4
BLAKE2b-256 dcf36f2efc4990b5ec1775773d22e39b11a57d22d2c56d9368bebbc6a83a9776

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.1.16-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 91ff24c33608988c0d10125626958090cbb5ff01a00302d9e83e52e56a37e8e9
MD5 43b32499ede3bf9fb7b3f65598d99d51
BLAKE2b-256 ff970bcc7f9de91f1608582150bdab0203f230345f7b4b3355d7c3f762c95d35

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