Longitudinal Drift-Diffusion Mixed Models (LDDMM)
Overview
Implementation of the drift-diffusion mixed model for category learning as described in Paulon et al. (2021) doi:10.1080/01621459.2020.1801448.
This major release introduces an improved sampler.
Model and defaults
- Every participant has one random effect curve for correct responses and one for incorrect responses (
random_effects = "correct-incorrect", the new default). A single curve for both is available withrandom_effects = "shared". - The maximum number of clusters at each block defaults to
min(K^2, 2K)(8 for 4 categories) and can be set withz_max. - Spline coefficients that start a curve have the normal prior of article eq. (9), with mean and variance set from the data (
hypers$mu_beta0_*,hypers$sigma2_beta0_*). - The smoothness of the fixed effects has a half-Cauchy prior on its standard deviation (scale
hypers$s_sigma_*). The upper limits on the variance parameters are documented hyperparameters (hypers$sigma2_1_max,hypers$sigma2_us_max,hypers$sigma2_ua_max).
Improved sampler
- A single implementation serves all boundary models, and the cluster-label and random-effect updates run in C++. Fits are about 12-21 times faster on the tone learning data.
- The cluster labels are updated with an exact locally informed Hamming ball sampler, and the cluster-specific spline coefficients with proposals built from the prior of article eq. (9).
- New joint moves improve mixing: a translation between fixed and random effects, a rescaling of the random effects together with their variances, and shifts of the offsets together with the drift and boundary levels.
- Coefficients of unused clusters are drawn close to those of the clusters in use (
hypers$pseudo_sd), so that curves move between clusters more easily. - Random effects start from each participant's moment estimates, and proposal scales are tuned during burn-in only, in batches of 50 iterations.
Show all changes in 1.0.0Hide the rest of the changes in 1.0.0
- Response-time distributions are evaluated on the log scale, which keeps them accurate for slow responses.
Other changes
- New
plot_predictive()for posterior predictive checks of the decisions and the response times. - Two worked examples are installed with the package (
system.file("examples", package = "lddmm")):toy_example.Ranalyses the bundled data, andtoy_simulation.Rsimulates data with known parameters and compares the posterior with the truth. The README and the vignette walk through fitting, posterior predictive checks and convergence diagnostics. - New arguments
save_z(store cluster labels),save_loglik,informed,verboseanddebug_checks; the fit also reports acceptance rates and the settings used. LDDMM()checks its input and reports problems with the data.log_likelihood_ind()returns a plain vector, andcompute_WAIC()is computed on the log scale.plot_accuracy()works without attaching dplyr.- The package no longer depends on gtools, LaplacesDemon, plyr, RColorBrewer, RcppProgress and rgen.
- Unit tests, and validation scripts in
tests/validation/(a Geweke joint distribution test, invariance tests of individual updates, and a simulate-and-recover study). - The documentation states that response times are in seconds.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-04-10
Show 2 earlier changesHide 2 earlier changes
- ERROR13 OK, 1 ERROR2026-04-09
- OK14 OK2026-03-10
Documentation
- Help pages
- 15 (1 internal)includes a package overview page
- Examples that run
- no examples
- Exported functions with examples
- 0%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 7%
- minimal_example HTML
Downloads
Repository
- PRs merged (all time)
- 50%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- not measured
Repository github.com/giorgiopaulon/lddmm is linked, but repository-practices checks have not run for it yet.
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 1.0.0Latest
- 0.4.22024-01-17 · diff ↗
- 0.4.02023-06-06 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.3.0
- 0.2.12023-01-31 · diff ↗
- 0.2.02023-01-28 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 0.1.02021-11-08
- RR 4.1.0 released · 2021-05-18
Package metadata
- First published
- 2021-11-08
- Total releases
- 7 / 5 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 75 KB / 1 file
- Download size
- 1.3 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("lddmm")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.