Skip to main content

No project description provided

Project description

HSSM - Hierarchical Sequential Sampling Modeling

Overview

HSSM is a Python toolbox that provides a seamless combination of state-of-the-art likelihood approximation methods with the wider ecosystem of probabilistic programming languages. It facilitates flexible hierarchical model building and inference via modern MCMC samplers. HSSM is user-friendly and provides the ability to rigorously estimate the impact of neural and other trial-by-trial covariates through parameter-wise mixed-effects models for a large variety of cognitive process models.

  • Allows approximate hierarchical Bayesian inference via various likelihood approximators.
  • Estimate impact of neural and other trial-by-trial covariates via native hierarchical mixed-regression support.
  • Extensible for users to add novel models with corresponding likelihoods.
  • Built on PyMC with support from the Python Bayesian ecosystem at large.
  • Incorporates Bambi's intuitive lmer-like regression parameter specification for within- and between-subject effects.
  • Native ArviZ support for plotting and other convenience functions to aid the Bayesian workflow.
  • Utilizes the ONNX format for translation of differentiable likelihood approximators across backends.

Installation

hssm is available through PyPI. You can install it with Pip via:

pip install hssm

You can also install the bleeding edge version of hssm directly from this repo:

pip install git+https://github.com/lnccbrown/hssm.git

Example

Here is a simple example of how to use HSSM:

import hssm
from hssm import load_data

# Load a package-supplied dataset
cav_data = load_data('cavanagh_theta')

# Define a basic hierarchical model with trial-level covariates
model = hssm.HSSM(
    model="ddm",
    data=cav_data,
    include=[
        {
            "name": "v",
            "prior": {
                "Intercept": {"name": "Uniform", "lower": -3.0, "upper": 3.0},
                "theta": {"name": "Uniform", "lower": -1.0, "upper": 1.0},
            },
            "formula": "v ~ (1|subj_idx) + theta",
            "link": "identity",
        },
    ],
)

# Sample from the posterior for this model
model.sample()

Example

HSSM is licensed under Copyright 2023, Brown University, Providence, RI

Support

For questions, bug reports, or other unexpected issues, please open an issue on the GitHub repository.

Contribution

If you want to contribute to this project, please familiarize yourself with our contribution guidelines.

Acknowledgements

We would like to extend our gratitude to the following individuals for their valuable contributions to the development of the HSSM package:

  • Bambi - A special thanks to the Bambi project for providing inspiration, guidance, and support throughout the development process. Tomás Capretto, a key contributor to Bambi, provided invaluable assistance in the development of the HSSM package.

Those contributions have greatly enhanced the functionality and quality of the HSSM.

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

hssm-0.1.0.tar.gz (84.2 kB view details)

Uploaded Source

Built Distribution

hssm-0.1.0-py3-none-any.whl (88.4 kB view details)

Uploaded Python 3

File details

Details for the file hssm-0.1.0.tar.gz.

File metadata

  • Download URL: hssm-0.1.0.tar.gz
  • Upload date:
  • Size: 84.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.13 Darwin/22.3.0

File hashes

Hashes for hssm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f5e8e170081493a0b3eb8c7b194f37cbad291b320c1dd6951b2a126f8cfd0a74
MD5 a40f523352ed64f689955a37e7b7c720
BLAKE2b-256 f77a7c73adb0cebdd9da82037e5c3b20aa81ce4fd6c5dc17e40dca28d11a286d

See more details on using hashes here.

File details

Details for the file hssm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hssm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 88.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.13 Darwin/22.3.0

File hashes

Hashes for hssm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7346bf9a6ed9936a14aa86103be9fb4edb56d6a347ed866d67f52861a20ef21
MD5 72a80db9af4b0d6f4a6aa7a16b6dc4d8
BLAKE2b-256 624e67f171630a550540181e7dbbcaf96c25aec838ffacefa2252fa23f161995

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