Skip to main content

Chi-square test with Monte Carlo simulation

Project description

chi2sim

Chi-square test with Monte Carlo simulation for contingency tables.

Installation

pip install chi2sim

Usage

import numpy as np
from chi2sim import chi2_cont_sim

# Example contingency table
table = np.array([
    [10, 5],
    [20, 15]
], dtype=int)

# Perform chi-square test with Monte Carlo simulation
result = chi2_cont_sim(table)
print(result)

Features

  • Fast C implementation of contingency table generation
  • Monte Carlo simulation for p-value approximation
  • Easy-to-use Python interface

Requirements

  • Python >= 3.9
  • NumPy >= 1.15.0

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use the chi2sim package in your work, please cite the following:

Hope, A. C. A. (1968). A simplified Monte Carlo significance test procedure. Journal of the Royal Statistical Society Series B, 30, 582–598. doi:10.1111/j.2517-6161.1968.tb00759.x.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chi2sim-1.0.1.tar.gz (69.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chi2sim-1.0.1-cp311-cp311-win_amd64.whl (97.0 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file chi2sim-1.0.1.tar.gz.

File metadata

  • Download URL: chi2sim-1.0.1.tar.gz
  • Upload date:
  • Size: 69.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for chi2sim-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0efaa2ae5b66305135341254bf27b4bdcca697af6aecf7a038185b0cf638095c
MD5 8e5dbe7d914d37a1238b640c4ed4383f
BLAKE2b-256 1b57ed519a9c2e1a3df5411926209e864e1df38ea4b1119fc5b8c24a0526f10f

See more details on using hashes here.

File details

Details for the file chi2sim-1.0.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: chi2sim-1.0.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 97.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.7

File hashes

Hashes for chi2sim-1.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cc6be5603b26e3634ece0429a24db50fb520c7daea80f65c323365958416982f
MD5 12c46fa3bde2560668200a22be587b11
BLAKE2b-256 3eafefce324c6f7447a3fb42c90575a3e8422be2f16b424ff01fb04546f4f9da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page