Skip to main content


mcpt: Monte Carlo permutation tests for Python

mcpt is a Python 3 library for calculating p-values through Monte Carlo permutation tests, providing an intuitive, simple, and highly customisable interface to determining statistical significance.

To get started, we recommend you read through Installation, Quickstart, and Functions sections of our read the docs documentation. Also check out the FAQ, which we update regularly. If you have concerns about the software, or feel that there is something that should be more explicit, then we’d love to hear from you – please open an issue on Github and we’ll get back in touch ASAP.

If you use mcpt in your research, please support us by citing the initial release:

David J. Skelton. (2019, September 5). mcpt: Monte Carlo permutation tests for Python (Version 0). Zenodo. http://doi.org/10.5281/zenodo.3387528

TLDR;

Installation

The simplest way to install this package is directly from PyPI using pip

pip install mcpt

Usage

mcpt contains two main functions: mcpt.permutation_test and mcpt.correlation_permutation_test.

Below is an example of the mcpt.permutation_test - for more info, please see the documentation here

>> import mcpt
>> x = [10, 9, 11]
>> y = [12, 11, 13]
>> f = "mean"
>> n = 100_000
>> side = "lower"

>> result = mcpt.permutation_test(x, y, f, side, n=n)
>> print(result)
Result(lower=0.09815650454064283, upper=0.10305649415095638, confidence=0.99)

Below is an example of mcpt.correlation_permutation_test - for more information, please see the documentation here

>> import mcpt
>> x = [-2.31, 1.06, 0.76, 1.38, -0.26, 1.29, -1.31, 0.41, -0.67, -0.58]
>> y = [-1.08, 1.03, 0.90, 0.24, -0.24, 0.76, -0.57, -0.05, -1.28, 1.04]
>> side = "both"
>> f = "pearsonr"

>> result = mcpt.correlation_permutation_test(x, y, f=f, side=side)
>> print(result)
Result(lower=0.021282451892029475, upper=0.029347445354757373, confidence=0.99)

Release files for mcpt 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcpt 0.1.8
File Size Uploaded
mcpt-0.1.8.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcpt 0.1.8
File Interpreter ABI Platform
mcpt-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / mcpt-0.1.8.tar.gz

Download URL mcpt-0.1.8.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f1d63c6149d9cc7854b3a1b9bfcac4e9febe88c7ba2e176ad3751f298511b3c8
BLAKE2b-256 checksum
How to use checksums
09689be6a5616a67ddd6639e10d6b9680aa68a17f5f7bb7c73e522f1c9b8484a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.1

Release files / mcpt-0.1.8-py3-none-any.whl

Download URL mcpt-0.1.8-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1605bf73a2587cda1de6a9cdc6b17333bc7119f0181d860c1507414b8dfe265
BLAKE2b-256 checksum
How to use checksums
173cf90d0af987d5298f7075a6b15548f59afb31cbf32338cd73d4200d5563c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page