High-dimensional Online Particle Estimation (HOPE) for psychophysical experiments
HOPE (High-dimensional Online Particle Estimation) is a Python package for adaptive psychophysics experiments.
Given a parametric psychometric function and a discrete stimulus pool, it selects the next stimulus with maximum expected information gain. It uses a posterior approximation based on a combined particle filtering–MCMC approach. This is fast enough for real-time use within the inter-stimulus interval for feature spaces up to 50 dimensions, typically under one second on standard hardware and with a stimulus pool of 10,000 stimuli. The package includes a set of predefined psychometric functions, but users can also supply their own. It is designed to integrate with PsychoPy experiments.
A preprint of the paper describing and evaluating the method in simulations and a real experiment is available on bioRxiv.
Installation
You can install HOPE using pip:
pip install psihope
Usage
from hope import HopeSampler
from hope.psychometric_functions import logistic_regression
from hope.psychometric_model import BinaryPsychometricModel
# 1. Define your priors
priors = {
"bias": stats.norm(scale=1),
"weights": stats.multivariate_normal(mean=np.zeros(2), cov=np.eye(2)),
}
# 2. Define your model
psychometric_model = BinaryPsychometricModel(
psychometric_function=logistic_regression, # choose from our library of psychometric functions or define your own
priors=priors,
)
# 3. Initialize the sampler
# define your stimulus pool here as a list of stimulus configurations
stimulus_pool = ...
sampler = HopeSampler(
psychometric_model=psychometric_model,
stimulus_pool=stimulus_pool,
seed=seed,
)
# 4. Run the experiment
for trial in range(num_trials):
stimulus = sampler.get_next_stimulus()
# Collect response from participant using e.g. PsychoPy
response = ...
sampler.update_posterior(stimulus, response)
For more advanced usage and more explanations refer to the examples directory.
Citation
If you use our tool, please cite our preprint:
@article{turon2026adaptive,
author = {Turon, Rabea and Reining, Lars C. and Hummel, Philipp A. and Schmittwilken, Lynn and Lind, Christine and Yu, Angela J. and Rothkopf, Constantin A. and J{\"a}kel, Frank and Wallis, Thomas S. A.},
title = {Adaptive experiments in high-dimensional feature spaces: A particle filtering approach},
year = {2026},
doi = {10.64898/2026.08.03.741989},
url = {https://www.biorxiv.org/content/early/2026/08/07/2026.08.03.741989},
eprint = {https://www.biorxiv.org/content/early/2026/08/07/2026.08.03.741989.full.pdf},
journal = {bioRxiv}
}
Metadata
Release files for psihope 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| psihope-0.1.1.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| psihope-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.3 kB
Release files / psihope-0.1.1.tar.gz
| Download URL | psihope-0.1.1.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4400a0b1a15234f7a7ae767c60e503b36fb77587571d9e34a9ce104c664dba40
|
|
BLAKE2b-256 checksum How to use checksums |
8ca4737d358849fa1ee02e2ec6242cdc6d9b463e74b72527ecba9f99c9c114ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.
Transparency logRelease files / psihope-0.1.1-py3-none-any.whl
| Download URL | psihope-0.1.1-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53c0c348f13a8c643ed51b5fe8a4725624b07c0bbe12349c84e613ad8e502363
|
|
BLAKE2b-256 checksum How to use checksums |
9bfe57b90c75192a52de5be1d2279609a102c77a787796eeb00c10ee808f2ddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.
Transparency log