Skip to main content

A statistics library project

Project description

KamiStats

KamiStats is a Python module designed to provide implementations of various statistical distributions, including but not limited to Binomial, Hypergeometric, and Poisson distributions. This library allows users to create instances of these distributions, calculate their probability mass functions (PMF), cumulative distribution functions (CDF), and other statistical properties such as mean, variance, and standard deviation.

Table of Contents

Installation

Instructions on how to install the necessary packages and set up the environment.

# Clone the repository
git clone https://github.com/kishimita/KamiStats.git

# Navigate to the project directory
cd KamiStats

# Install the required dependencies
pip install -r requirements.txt

Usage

Below are 3 examples of how to use the distributions of this module to calculate the probability mass function, cumulative probability function, mean, varience and standard deviation. For the rest of the distributions the code is self explanatory and has similar implementation as the ones in the example below.

Binomial Distribution

The BinomialDist class represents a binomial distribution.

Example

from KamiStats import distributions as dist

# Create a Binomial distribution instance
binom_dist = dist.BinomialDist(n=10, p=0.5, q=0.5, k=5)

# Calculate the probability mass function
print(binom_dist.pmf())

# Calculate the cumulative distribution function
print(binom_dist.cdf())

# Get the mean
print(binom_dist.mean)

# Get the variance
print(binom_dist.variance)

# Get the standard deviation
print(binom_dist.std_dev)

Hypergeometric Distribution

The HypergeometricDist class represents a hypergeometric distribution.

Example

from KamiStats import distributions as dist 

# Create a Hypergeometric distribution instance
hypergeom_dist = dist.HypergeometricDist(N=20, n=10, K=5, k=3)

# Calculate the probability mass function
print(hypergeom_dist.pmf())

# Calculate the cumulative distribution function
print(hypergeom_dist.cdf())

# Get the mean
print(hypergeom_dist.mean)

# Get the variance
print(hypergeom_dist.variance)

# Get the standard deviation
print(hypergeom_dist.std_dev)

Poisson Distribution

The PoissonDist class represents a Poisson distribution.

Example

from KamiStats import distributions as dist 

# Create a Poisson distribution instance
poisson_dist = dist.PoissonDist(λ=4, k=2)

# Calculate the probability mass function
print(poisson_dist.pmf())

# Calculate the cumulative distribution function
print(poisson_dist.cdf())

# Get the mean
print(poisson_dist.mean)

# Get the variance
print(poisson_dist.variance)

# Get the standard deviation
print(poisson_dist.std_dev)

Not for Use!

Any file in the test_scripts, and tests. This was used for unittest and due to files and folder struectures the code does not work.

Dependencies

List of dependencies required for the project are listed here and in the requirements.txt file.

    Package Version
    ------- -------
    mpmath  1.3.0
    numpy   2.0.1
    pip     24.2
    scipy   1.14.0
    sympy   1.13.2

License

Copyright 2024 Kishimita Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

kamistats-0.1.2.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

KamiStats-0.1.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file kamistats-0.1.2.tar.gz.

File metadata

  • Download URL: kamistats-0.1.2.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for kamistats-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7cd178f2a41ee579ff7533e1eea788c6efe2ae1682cc3f78429e4acae20035e3
MD5 097cf0f9f79300d2ed0e3861f27f44ff
BLAKE2b-256 6f3bda68e44f288a9cd810757870e00a630b5f6349b698def747f3ef779a2136

See more details on using hashes here.

File details

Details for the file KamiStats-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: KamiStats-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for KamiStats-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 65c79f508adb929caab0a0a51c6a573b58861e92ef70ed4f2080b0d491a9c40e
MD5 61efd12a67c8d25bc3c7dc598e7aa6be
BLAKE2b-256 383246c99d5d4583cd788cda4ec410f122585ed61cc247b82ea7000b91ebcd2c

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