The package provides a robust and sparse group-level extension of Parametric Empirical Bayes for Dynamic Causal Modelling (DCM), together with an R port of deterministic single-state fMRI DCM routines from SPM25.

Details

The proposed group method combines a Student-t likelihood on pre-whitened first-level posterior summaries with a Gaussian-spike and nonlocal product-moment (pMOM)-slab prior. Mode fitting uses a multistart generalized EM algorithm with conditional maximization. Posterior inclusion probabilities are integrated conditionally on fitted empirical-Bayes hyperparameters by parallel-tempering MCMC. Conditional Laplace standard deviations are also returned for the group coefficients.

Main functions

rsdcm

Fit the robust and sparse group model.

rsdcm_fit

Assemble group inputs from fitted DCMs.

dcm_estimate

Invert a single-subject fMRI DCM.

dcm_peb_run

Fit the Gaussian SPM-style PEB model.

Other functions

rsdcm_options

Get or set package numerical options.

dcm_nlsi_GN

Variational Laplace / Gauss-Newton inversion.

dcm_int

Bilinear-system integrator (forward model).

dcm_fmri_priors

Construct fMRI DCM priors.

dcm_fx_fmri, dcm_gx_fmri

Neural-state and BOLD observation equations.

dcm_bireduce, dcm_kernels

Bilinear reduction and Volterra kernels.

dcm_evidence, dcm_log_evidence, dcm_log_evidence_reduce

Model evidence and Bayesian model reduction.

dcm_peb_prepare, dcm_peb_run

Prepare and fit a second- or third-level PEB.

dcm_peb_design, dcm_peb_files, dcm_peb_load

Design-matrix and subject-PEB loading helpers.

Lower-level numerical helpers (matrix and vector utilities, numerical differentiation, matrix exponentials, and error-covariance bases) are also exported and documented; see, for example, dcm_vec, dcm_inv, dcm_diff, and dcm_Ce.

Datasets

toy_dcm

Three-region single-subject DCM specification.

narps_dcm

Corrected 48-subject NARPS DCM summaries.

Lower-level numerical helpers (matrix and vector utilities, numerical differentiation, matrix exponentials, and error-covariance bases) are also exported and documented; see, for example, dcm_vec, dcm_inv, dcm_diff, and dcm_Ce.

Acknowledgment

The single-subject DCM routines are a derivative work of the MATLAB SPM25 (version 25.01.02) toolbox, distributed under GPL-2 by the Wellcome Centre for Human Neuroimaging. See the LICENSE.note file in the package source for the list of ported routines.

References

Arhin, G. and Sanyal, N. (2026). Robust and Sparse Group Dynamic Causal Modeling via Student-t Parametric Empirical Bayes and Nonlocal Priors. arXiv:2609.06379. doi:10.48550/arXiv.2609.06379

Friston, K. J., Harrison, L., and Penny, W. (2003). Dynamic causal modelling. NeuroImage, 19(4), 1273–1302. doi:10.1016/S1053-8119(03)00202-7

Friston, K.J., Mattout, J., Trujillo-Barreto, N., Ashburner, J., Penny, W. (2007). Variational free energy and the Laplace approximation. NeuroImage, 34(1), 220-234. doi:10.1016/j.neuroimage.2006.08.035

Botvinik-Nezer, R., Holzmeister, F., Camerer, C. F., et al. (2020). Variability in the analysis of a single neuroimaging dataset by many teams. Nature, 582(7810), 84-88. doi:10.1038/s41586-020-2314-9

Valerio, D., Peres, A., Bergstrom, F., Seidel, P., Almeida, J. (2025). Neural and behavioral similarity-driven tuning curves for manipulable objects. Imaging Neuroscience, 3. doi:10.1162/imag_a_00482

Author

Maintainer: Godfred Arhin arhin0122@gmail.com [translator] Authors:

Other contributors:

  • SPM25 Authors (Original MATLAB SPM25 (v25.01.02) implementation; see LICENSE.note) [contributor, copyright holder]