tycki
A simple Python tool for MCMC sampling using the amazing MCMClib.
Installation
tycki is on PyPI, so just
pip install tycki
Usage
tycki provides four samples from MCMClib:
- Random-walk Metropolis-Hastings
tycki.RWMH - Metropolis-adjusted Langevin algorithm
tycki.MALA - Hamiltonian Monte Carlo
tycki.HMC - No-U-Turn sampler
tycki.NUTS
For sampling, the algorithms just require a start point, a log density function and - depending on the algorithm - the gradient of the log density function:
import tycki
rwmh = tycki.RWMH()
samples = rwmh.sample(log_density=lambda x: -(x**2).sum(), x0=[0, 0])
mala = tycki.MALA(x0=[0, 0]) # starting point can also be given in constructor
samples = mala.sample(log_density=lambda x: -(x**2).sum(), grad_log_density=lambda x: -2*x)
If you're too lazy to derive the gradient of your log density function manually, you can also use
AD tools like jax:
import tycki
import jax
from jax import grad
@jax.jit
def logp(x, s=1):
return -.5*(x**2 / s**2).sum()
rwmh = tycki.RWMH(x0=[0, 0])
samples = rwmh.sample(logp, grad(logp))
mala = tycki.MALA(x0=[0, 0])
samples = mala.sample(logp, grad(logp))
Licensing
This project is based on the amazing MCMClib by Keith O'Hara, licensed under the Apache License 2.0. Modifications and additions in order to make the by Richard D. Paul are licensed under MIT License.
See the LICENSE file for the full text of the MIT License.
Metadata
Release files for tycki 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tycki-0.0.8.tar.gz | 3.8 MB | Without provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tycki-0.0.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details |
| tycki-0.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
| tycki-0.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.17+ x86-64 | Details |
| tycki-0.0.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | CPython 3.9 | Linux glibc 2.17+ x86-64 | Details |
| tycki-0.0.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 6.0 MB
Release files / tycki-0.0.8.tar.gz
| Download URL | tycki-0.0.8.tar.gz |
|---|---|
| Size | 3.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37159aa979b3453d691d3d38376308efd51c8432019534706ce8efe8075dbb1d
|
|
BLAKE2b-256 checksum How to use checksums |
f88138c47f54c59baeb7b2418b792d91447b7e517c7e276a41cf3c42fdbc4eb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / tycki-0.0.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tycki-0.0.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 447.3 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ebd07a7b025939123b678d2e92755356837c7740ac4c777a5043804adfcb030c
|
|
BLAKE2b-256 checksum How to use checksums |
4ead5e99cf52073be3c5d0d900f0df8e33afed9d5cd746156373815510387196
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / tycki-0.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tycki-0.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 444.4 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2b0b9ab659a0682c4f114a08f6dd70ada98d99a8f6ecfb0265622338421ea003
|
|
BLAKE2b-256 checksum How to use checksums |
9fd386eba85620773c65001f78183fec563fe491b72afbbd7cffa265e9b4d029
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / tycki-0.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tycki-0.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 443.0 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ceabaf4a04faa96091e869c5fc53da81515ea58211fa251007a8db7be727f600
|
|
BLAKE2b-256 checksum How to use checksums |
019a9f0f2a805e8f496d4bbb1ec90854490c20e37fa638d30d34a9340dfe6ad7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / tycki-0.0.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tycki-0.0.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 442.7 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e5f5012989167282aa5f15bfb71e3f8c19b5ad4ff04a34ef4a44211c277b967b
|
|
BLAKE2b-256 checksum How to use checksums |
79c494c600bf68074a62f2457c73657a1033ca809dc546d1df5d80ecf704ddf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Release files / tycki-0.0.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | tycki-0.0.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 442.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6332430c7c1e8ce6b10880f4d9a1644f801aa27b0336215f95c6765180c5009f
|
|
BLAKE2b-256 checksum How to use checksums |
b0c3cd55970737c45079cb3f477353ab8521ecda67b9e00f7b3575316324f4ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.12
|
Security for tycki 0.0.8
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.