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=3, max_alpha_beta=True, scale_result=False, 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.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.5-cp311-cp311-macosx_10_15_x86_64.whl (223.2 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.5-cp310-cp310-macosx_10_15_x86_64.whl (223.2 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.5-cp39-cp39-macosx_10_15_x86_64.whl (223.2 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.5-cp38-cp38-macosx_10_15_x86_64.whl (223.2 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.9 kB view details)

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

multidimensionalks-0.2.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.7 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 043d6d3db129256ff7e70326e0e7da32af2222aaa0dc2d03d931d240723fa816
MD5 03bdc12a39d16a7ecd22c3691d0a0105
BLAKE2b-256 e719eeffe93154ac22b7e1da45d342d967036eac134e1ab043546be4d2da1b31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3b4c5a5e24d76f5312433b8b33fac9cd43758df1092c1220207192977c3f2d47
MD5 a3194d1e193f1d273d4fcf22aa0ba79c
BLAKE2b-256 56fda47200e565c76f2436901e544c32d7eee69310c985c093b136ce7f8c461b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9dbffb75fb03fa1325f4c6760a97c1c76f00cb4e4ee768a1b85fb85fd2439ced
MD5 26f7206efeb3b05b3e20175e85541b4c
BLAKE2b-256 d705e822962571f1ed7263e966da6b057654f0393076bbdd4b3d89dbd14bb077

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2b4ee320e9e39ac1a96cffdd5beb086240c5190bb34d3b51e66009bfed314603
MD5 5924bf0e5f02950e1f952fadddac611e
BLAKE2b-256 109604a6d7c96830995ad2b8fd2d04cf4215d506d9752a69db075860daccd530

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd23687d06ca35e89a355b9345a5230ca105f554ee77b5b986861aad144d96d6
MD5 4be2149aa06fa6d151d447490360b07e
BLAKE2b-256 9651c4d5d39412d4a73f7b75282a21f87604094f2920b7a6ee982d4f677632fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b4c6c54922d99706aec2d11d278c858d219d6c4a8497139fc0a52a9b7044c28c
MD5 eef025cde892a17b31a1ece34824cf2c
BLAKE2b-256 a7383b525beab7fe95e98b5b3a776d1d4dd8883ebaf89ef2bf26957c2ebe5faa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07fa6873090248eb30ccdf777a310d4d556fe9f85d224e8b63e9e3fbc6003047
MD5 01833ca0dd51be4d7619f0990b554f2c
BLAKE2b-256 98a787fc758cecc7e681a4c0f2c4f6973d445f26e7f1197a5cef64ba5bd051e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 29044089a27df1a243c1f8a42db89772e143bb1ab97fade867be7a31e1f46b27
MD5 4dbf399826e13ec88f198ba65c03cf28
BLAKE2b-256 74cdbe7896b4aba3563fda66487d82dd8550f1a0f25c36b8cd61726bbc0ab37e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c4180feca74e5f3c64675fc663ac94db6b12d6ad01d70ece2ee43dc767b8924
MD5 6d5510937987d7d46e3aa67714e75ab9
BLAKE2b-256 862040ee0e3da16fade406219f2df155095fc8b6922f5faefc6957bf5c7afd27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d9304e89d29fe4bda1b5ab97ff891c395874decba5b9585b26b17a1f36a605b6
MD5 044908aa12f80f88489dd7a9972da4ed
BLAKE2b-256 fb1e40c6014320d991a543023277817f110279bb77655dd8112562d78984116d

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