Python Package which collects simulators for Sequential Sampling Models.
Find the package documentation here.
The ssms
package serves two purposes.
- Easy access to fast simulators of sequential sampling models
- Support infrastructure to construct training data for various approaches to likelihood / posterior amortization
A number of tutorial notebooks are available under the /notebooks
directory.
pip install ssm-simulators
Note
Building from source or developing this package requires a C compiler (such as GCC). On Linux, you can install GCC with:
sudo apt-get install build-essential
Most users installing from PyPI wheels do not need to install GCC.
The package exposes a command-line tool, generate
, for creating training data from a YAML configuration file.
generate --config-path <path/to/config.yaml> --output <output/directory> [--log-level INFO]
--config-path
: Path to your YAML configuration file (required).--output
: Directory where generated data will be saved (required).--n-files
: (Optional) Number of data files to generate. Default is1
file.--log-level
: (Optional) Set the logging level (DEBUG
,INFO
,WARNING
,ERROR
,CRITICAL
). Default isWARNING
.
Below is a sample YAML configuration you can use with the generate
command:
MODEL: 'ddm'
N_SAMPLES: 2000
N_PARAMETER_SETS: 100
DELTA_T: 0.001
N_TRAINING_SAMPLES_BY_PARAMETER_SET: 200
N_SUBRUNS: 20
GENERATOR_APPROACH: 'lan'
Configuration file parameter details follow.
Option | Definition |
---|---|
MODEL |
The type of model you want to simulate |
N_SAMPLES |
Number of samples a simulation run should entail for a given parameter set |
N_PARAMETER_SETS |
Number of parameter vectors that are used for training |
DELTA_T |
Time discretization step used in numerical simulation of the model. Interval between updates of evidence-accumulation. |
N_TRAINING_SAMPLES_BY_PARAMETER_SET |
Number of times the kernal density estimate (KDE) is evaluated after creating the KDE from simulations of each set of model parameters. |
N_SUBRUNS |
Number of repetitions of each call to generate data |
GENERATOR_APPROACH |
Type of generator used to generate data |
To make your own configuration file, you can copy the example above into a new .yaml
file and modify it with your preferences.
If you are using uv
(see below), you can use the uv run
command to run generate
from the command line
This will generate training data according to your configuration and save it in the specified output directory.
Check the basic tutorial here.
We use uv
for fast and efficient dependency management. To get started:
- Install
uv
:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Install dependencies (including development):
uv sync --all-groups # Installs all dependency groups