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 avx, 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.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.7-cp311-cp311-macosx_10_15_x86_64.whl (230.8 kB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

multidimensionalks-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.7-cp310-cp310-macosx_10_15_x86_64.whl (230.8 kB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

multidimensionalks-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.7-cp39-cp39-macosx_10_15_x86_64.whl (230.8 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

multidimensionalks-0.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

multidimensionalks-0.2.7-cp38-cp38-macosx_10_15_x86_64.whl (230.8 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

multidimensionalks-0.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (325.2 kB view details)

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

multidimensionalks-0.2.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324.9 kB view details)

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

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e67f287aa0b86150d03b98d1251611c3ee1232fc3586b4869161ebc0694a8950
MD5 ec8692a121c43e180ad3a4f2f7a3b850
BLAKE2b-256 7f9b4b1a3738b8cecdd9b5457d16c6de5ccc89359ce9334c388aae6ab94a183f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3828786b36699d6c1e96e790a29bee7d5507eee2b2e57330f0580edb454fb889
MD5 b3d7ecee5c6bdb35b9cbf5c72d80c631
BLAKE2b-256 b298ca6b943154c334dd8eeb2672ec5ae4140fdb136306f078bdad507189f227

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7aafe3f00b1e3d50022be92313a2ed37cc0cf9d9840e481991fb55c54f75c664
MD5 c6739695113e898bfa88a0ec88bde5eb
BLAKE2b-256 4a8453a0f5e7192ce1ae885a6080f1a17285f5d15158bc45aab34deff7ec5cca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 870e9fb59d03e74a264bfc495e64fc3e04b711998ab4afe507920f0f8f94e6ff
MD5 99ce7281699b346ef25b99780bafd023
BLAKE2b-256 5789641a6a0f305d83b23c86fa2a9e7d6b7b737c9fa3047fa77d3742721bb9e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2077304295b55b2ecae9882c7fc14dbdd3a23e5882dedcd06d2207bf3493e1ca
MD5 a2586f8d7ec82a4a04245dba5f0cbb8c
BLAKE2b-256 44df58b688eca5ba6a23d553ba4233aaa2882399f363c495a452587bd6c69330

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6e9186a6c083f1e64234e7f0b49dca403e5bb2b702422d80bb3773e0e145ddfa
MD5 62a7079f0e9f784ca1b60649c0a6c2e4
BLAKE2b-256 bc743f621236bdd5e1313ccef84d7d57ec4292ac1af0ad8989fda448cdeb64d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38008c031e7030d1f68c4efea0e46b94ec0e558869c8ce573a136c2c1a6c5da7
MD5 68a4bad34123c26f7dec2f797b7be6ef
BLAKE2b-256 8dd7776ba454df26b4dd38c48312e8bae7f7ff7685ae23df36a00a2ec19f240a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9fa5ae96591d063fa1826df6ec6bdbcce8332aae28e753c27cbaeba2eb6dce70
MD5 b78747ae4c0676a9517e976f6f86ff8b
BLAKE2b-256 9d06ab098ceb2f58ada9e273213b36c18e19eacefd9a195bcda8fd87d09f0924

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a1d6b8ae1eef9c8cba67046444875d95bd1356c83b69924651a22c91a75f84a4
MD5 808d3ced38f07438e8c070a67819343c
BLAKE2b-256 d6562180487630b44154c6d49505308c34d5340d4266f2be512e138624cba7ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multidimensionalks-0.2.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e49107ed8c222e532f4351b83a329fff4d0553b0bb232c789b6227ee35fd5e52
MD5 830ef9f9a7d6ed2584f7be3b36679be3
BLAKE2b-256 79cfce1cbe17ec6bf152bf77c0db171ab8256a60dc1bc62c4b0e20e61981b3e9

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