Skip to main content

Welcome to stochastics

Version PyPI - Python Version License: MIT

A simple library to help solving stochastic processes and finding resulting probilities of common applications

Installation / How to use

To use this library is pretty easy. First you will need to install the library from PyPI. Make sure you are running Python version 3.8 or above:

pip install stochastics

The you can use the library in your own python code, like this:

from stochastics.models import MarkovChain

# define some initial values for a markov chain
initial_probabilities = [0.3, 0.4]
transition_matrix = [
    [0.1, 0.9],
    [0.7, 0.3],
]

# create the markov chain with the parameters
mc = MarkovChain(initial_probabilities, trans_matrix=transition_matrix)
# find the probability of ending up in a state given a sequence of steps
p = mc.get_probability_from_sequence(state_sequence=[0, 1, 0])
print(p)

More utilization examples and API documentation can be seem in the docs.

Development Setup

So you want to contribute to the development, that is very welcome! To develop this project there're only two initial requirements:

  • Python 3.8+
  • Having pip or pipenv installed

After making sure those requirements are fullfilled, you can simple run this command with pip:

pip install -r requirements-dev.txt

If you like pipenv, just do:

pipenv install --dev

That is already all you need. Just make sure to follow the Contribution Guidelines and you are all set.

After doing your work and getting ready to make your PR, I recommend you to use pre-commit to fix some standards and make sure nothing really can get in the way of your contribution.

Run tests

There're tests in this project, and the best way to see how things work under the hood and check if you changes are ok, simply run the tests with pytest:

pytest

You can also see if the current test coverage of the project is good by running:

pytest --cov

Need help? Found an bug? Have a good idea?

I encourage you to look around in the issues section, see if someone else is working on a fix for your problem, there's already a report for the bug, or some new feature being dicussed that you are interested. If you found nothing, feel free to create an issue using one of the provided templates.

Author

Robson Cruz

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

Metadata

Release files for stochastics 0.4.0

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

Source distribution (sdist)

Source distribution for stochastics 0.4.0
File Size Uploaded Provenance Actions
stochastics-0.4.0.tar.gz 7.1 kB Without provenance Details for stochastics-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stochastics 0.4.0
File Interpreter ABI Platform Actions
stochastics-0.4.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for stochastics-0.4.0-py2.py3-none-any.whl

Total release size: 13.4 kB

Release files / stochastics-0.4.0.tar.gz

Download URL stochastics-0.4.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
867a7d75f8d68d6ced8d2c3d26175c713dbf6c54ab2a2df9ae9ffa84870cd881
BLAKE2b-256 checksum
How to use checksums
a0a43303a784fe47deacdce6aafc647c4c6bdd13f27eee0e033a91023bb8cd30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

Release files / stochastics-0.4.0-py2.py3-none-any.whl

Download URL stochastics-0.4.0-py2.py3-none-any.whl
Size 6.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c26dabc964b3a38a5bfdc4799da504a250f9884801947094cedaf5cc2a47b863
BLAKE2b-256 checksum
How to use checksums
75c5f40fe8df69468fde06db23775de40ae4536c1ebf967ef31d50f50304828a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

Security for stochastics 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

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