HSSM


NameHSSM JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/lnccbrown/HSSM
SummaryBayesian inference for hierarchical sequential sampling models.
upload_time2024-01-19 14:50:35
maintainer
docs_urlNone
authorAlexander Fengler
requires_python>=3.10,<3.12
licenseCopyright 2023, Brown University, Providence, RI.
keywords hssm sequential sampling models bayesian bayes mcmc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div style="position: relative; width: 100%;">
  <img src="docs/images/mainlogo.png" style="width: 250px;">
  <a href="https://ccbs.carney.brown.edu/brainstorm" style="position: absolute; right: 0; top: 50%; transform: translateY(-50%);">
    <img src="docs/images/Brain-Bolt-%2B-Circuits.gif" style="width: 100px;">
  </a>
</div>

## HSSM - Hierarchical Sequential Sampling Modeling

![PyPI](https://img.shields.io/pypi/v/hssm)
![PyPI - Downloads](https://img.shields.io/pypi/dm/HSSM?link=https%3A%2F%2Fpypi.org%2Fproject%2Fhssm%2F)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hssm)
![GitHub pull requests](https://img.shields.io/github/issues-pr/lnccbrown/HSSM)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/lnccbrown/HSSM/run_tests.yml)
![GitHub Repo stars](https://img.shields.io/github/stars/lnccbrown/HSSM)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

### 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. HSSM is a <a href="https://ccbs.carney.brown.edu/brainstorm">BRAINSTORM</a> project in collaboration with the Center for Computation and Visualization and the Center for Computational Brain Science within the Carney Institute at Brown University.

- 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.

### [Official documentation](https://lnccbrown.github.io/HSSM/).

## 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
```

You will need optional dependencies to use JAX-based samplers and graph the models.
Please refer to our [installation guide](https://lnccbrown.github.io/HSSM/getting_started/installation/)
for more detailed instructions.

**Note**: Possible solutions to any issues with installations with hssm can be located
[here](https://github.com/lnccbrown/HSSM/discussions). We recommend leveraging an
environment manager with Python 3.10~3.11 to prevent any problems with dependencies
during the installation process. Please note that hssm is tested for python 3.10,
3.11. As of HSSM v0.2.0, support for Python 3.9 is dropped. Use other python
versions with caution.

## Example

Here is a simple example of how to use HSSM:

```python
import hssm

# Set float type to float32 to avoid a current bug in PyMC
# This will not be necessary in the future
hssm.set_floatX("float32")

# Load a package-supplied dataset
cav_data = hssm.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": "Normal", "mu": 0.0, "sigma": 0.1},
                "theta": {"name": "Normal", "mu": 0.0, "sigma": 0.1},
            },
            "formula": "v ~ (1|participant_id) + theta",
            "link": "identity",
        },
    ],
)

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

To quickly get started with HSSM, please follow [this tutorial](https://lnccbrown.github.io/HSSM/getting_started/getting_started/).
For a deeper dive into HSSM, please follow [our main tutorial](https://lnccbrown.github.io/HSSM/tutorials/main_tutorial/).

## License

HSSM is licensed under [Copyright 2023, Brown University, Providence, RI](LICENSE)

## Support

For questions, please feel free to [open a discussion](https://github.com/lnccbrown/HSSM/discussions).

For bug reports and feature requests, please feel free to [open an issue](https://github.com/lnccbrown/HSSM/issues) using the corresponding template.

## Contribution

If you want to contribute to this project, please follow our [contribution guidelines](docs/CONTRIBUTING.md).

## Acknowledgements

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

- [Bambi](https://github.com/bambinos/bambi) - A special thanks to the Bambi project for providing inspiration, guidance, and support throughout the development process. [Tomás Capretto](https://github.com/tomicapretto), 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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lnccbrown/HSSM",
    "name": "HSSM",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<3.12",
    "maintainer_email": "",
    "keywords": "HSSM,sequential sampling models,bayesian,bayes,mcmc",
    "author": "Alexander Fengler",
    "author_email": "alexander_fengler@brown.edu",
    "download_url": "https://files.pythonhosted.org/packages/3b/5a/4ebb0ada83a8346f9df77f71549857876317bcd3201d5071f1774b2d64b7/hssm-0.2.0.tar.gz",
    "platform": null,
    "description": "<div style=\"position: relative; width: 100%;\">\n  <img src=\"docs/images/mainlogo.png\" style=\"width: 250px;\">\n  <a href=\"https://ccbs.carney.brown.edu/brainstorm\" style=\"position: absolute; right: 0; top: 50%; transform: translateY(-50%);\">\n    <img src=\"docs/images/Brain-Bolt-%2B-Circuits.gif\" style=\"width: 100px;\">\n  </a>\n</div>\n\n## HSSM - Hierarchical Sequential Sampling Modeling\n\n![PyPI](https://img.shields.io/pypi/v/hssm)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/HSSM?link=https%3A%2F%2Fpypi.org%2Fproject%2Fhssm%2F)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hssm)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/lnccbrown/HSSM)\n![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/lnccbrown/HSSM/run_tests.yml)\n![GitHub Repo stars](https://img.shields.io/github/stars/lnccbrown/HSSM)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\n### Overview\n\nHSSM 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. HSSM is a <a href=\"https://ccbs.carney.brown.edu/brainstorm\">BRAINSTORM</a> project in collaboration with the Center for Computation and Visualization and the Center for Computational Brain Science within the Carney Institute at Brown University.\n\n- Allows approximate hierarchical Bayesian inference via various likelihood approximators.\n- Estimate impact of neural and other trial-by-trial covariates via native hierarchical mixed-regression support.\n- Extensible for users to add novel models with corresponding likelihoods.\n- Built on PyMC with support from the Python Bayesian ecosystem at large.\n- Incorporates Bambi's intuitive `lmer`-like regression parameter specification for within- and between-subject effects.\n- Native ArviZ support for plotting and other convenience functions to aid the Bayesian workflow.\n- Utilizes the ONNX format for translation of differentiable likelihood approximators across backends.\n\n### [Official documentation](https://lnccbrown.github.io/HSSM/).\n\n## Installation\n\n`hssm` is available through PyPI. You can install it with pip via:\n\n```\npip install hssm\n```\n\nYou can also install the bleeding-edge version of `hssm` directly from this repo:\n\n```\npip install git+https://github.com/lnccbrown/HSSM.git\n```\n\nYou will need optional dependencies to use JAX-based samplers and graph the models.\nPlease refer to our [installation guide](https://lnccbrown.github.io/HSSM/getting_started/installation/)\nfor more detailed instructions.\n\n**Note**: Possible solutions to any issues with installations with hssm can be located\n[here](https://github.com/lnccbrown/HSSM/discussions). We recommend leveraging an\nenvironment manager with Python 3.10~3.11 to prevent any problems with dependencies\nduring the installation process. Please note that hssm is tested for python 3.10,\n3.11. As of HSSM v0.2.0, support for Python 3.9 is dropped. Use other python\nversions with caution.\n\n## Example\n\nHere is a simple example of how to use HSSM:\n\n```python\nimport hssm\n\n# Set float type to float32 to avoid a current bug in PyMC\n# This will not be necessary in the future\nhssm.set_floatX(\"float32\")\n\n# Load a package-supplied dataset\ncav_data = hssm.load_data('cavanagh_theta')\n\n# Define a basic hierarchical model with trial-level covariates\nmodel = hssm.HSSM(\n    model=\"ddm\",\n    data=cav_data,\n    include=[\n        {\n            \"name\": \"v\",\n            \"prior\": {\n                \"Intercept\": {\"name\": \"Normal\", \"mu\": 0.0, \"sigma\": 0.1},\n                \"theta\": {\"name\": \"Normal\", \"mu\": 0.0, \"sigma\": 0.1},\n            },\n            \"formula\": \"v ~ (1|participant_id) + theta\",\n            \"link\": \"identity\",\n        },\n    ],\n)\n\n# Sample from the posterior for this model\nmodel.sample()\n```\n\nTo quickly get started with HSSM, please follow [this tutorial](https://lnccbrown.github.io/HSSM/getting_started/getting_started/).\nFor a deeper dive into HSSM, please follow [our main tutorial](https://lnccbrown.github.io/HSSM/tutorials/main_tutorial/).\n\n## License\n\nHSSM is licensed under [Copyright 2023, Brown University, Providence, RI](LICENSE)\n\n## Support\n\nFor questions, please feel free to [open a discussion](https://github.com/lnccbrown/HSSM/discussions).\n\nFor bug reports and feature requests, please feel free to [open an issue](https://github.com/lnccbrown/HSSM/issues) using the corresponding template.\n\n## Contribution\n\nIf you want to contribute to this project, please follow our [contribution guidelines](docs/CONTRIBUTING.md).\n\n## Acknowledgements\n\nWe would like to extend our gratitude to the following individuals for their valuable contributions to the development of the HSSM package:\n\n- [Bambi](https://github.com/bambinos/bambi) - A special thanks to the Bambi project for providing inspiration, guidance, and support throughout the development process. [Tom\u00e1s Capretto](https://github.com/tomicapretto), a key contributor to Bambi, provided invaluable assistance in the development of the HSSM package.\n\nThose contributions have greatly enhanced the functionality and quality of the HSSM.\n",
    "bugtrack_url": null,
    "license": "Copyright 2023, Brown University, Providence, RI.",
    "summary": "Bayesian inference for hierarchical sequential sampling models.",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/lnccbrown/HSSM",
        "Repository": "https://github.com/lnccbrown/HSSM"
    },
    "split_keywords": [
        "hssm",
        "sequential sampling models",
        "bayesian",
        "bayes",
        "mcmc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66756d4ef5824579026b1a558661a9df7da9409724ba93ae6b40a0471a5acfed",
                "md5": "2febadb4a829a8b06884b2209b6114a7",
                "sha256": "2ae5cdf064367669cbf5ce5c45f77fd56ed490ddba682648a35f3f63fcfd7e9e"
            },
            "downloads": -1,
            "filename": "hssm-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2febadb4a829a8b06884b2209b6114a7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<3.12",
            "size": 166159,
            "upload_time": "2024-01-19T14:50:33",
            "upload_time_iso_8601": "2024-01-19T14:50:33.296473Z",
            "url": "https://files.pythonhosted.org/packages/66/75/6d4ef5824579026b1a558661a9df7da9409724ba93ae6b40a0471a5acfed/hssm-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3b5a4ebb0ada83a8346f9df77f71549857876317bcd3201d5071f1774b2d64b7",
                "md5": "07517b34c530ae85e5774761628a7a6a",
                "sha256": "a4b874ff970cdef38ca1d6ec738edb1708b6a9b5e5243b7e4217d4a428be4842"
            },
            "downloads": -1,
            "filename": "hssm-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "07517b34c530ae85e5774761628a7a6a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<3.12",
            "size": 156970,
            "upload_time": "2024-01-19T14:50:35",
            "upload_time_iso_8601": "2024-01-19T14:50:35.226256Z",
            "url": "https://files.pythonhosted.org/packages/3b/5a/4ebb0ada83a8346f9df77f71549857876317bcd3201d5071f1774b2d64b7/hssm-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-19 14:50:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lnccbrown",
    "github_project": "HSSM",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hssm"
}
        
Elapsed time: 0.17708s