rsDCM provides a robust and sparse method for group-level Dynamic Causal Modelling (DCM) of fMRI data, together with an R implementation of single-subject DCM ported from the MATLAB SPM25 toolbox.

Details

The package's main method is rsdcm (with the convenience wrapper rsdcm_fit): a group-level model that weights subjects by a Student-t likelihood (robustness to outliers) and selects group-level effects with a nonlocal product-moment (pMOM) spike-and-slab prior (sparsity), with ReML-estimated between-subject variance components. The “rs” is robust and sparse; it does not denote resting-state fMRI.

For single-subject inversion, the main entry point is dcm_estimate.

Group-level modelling (robust and sparse)

rsdcm

Robust, sparse group DCM (Student-t + pMOM).

rsdcm_fit

Assemble rsdcm inputs from a list of fitted DCMs.

rsdcm_options

Get or set package numerical options.

Single-subject DCM estimation (SPM25 port)

dcm_estimate

Full DCM inversion (main entry point).

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.

Parametric Empirical Bayes (Gaussian group modelling)

dcm_peb_prepare, dcm_peb_run

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

dcm_peb_of_pebs

Third-level PEB-of-PEBs over a directory of subject PEBs.

dcm_peb_design, dcm_peb_files, dcm_peb_load

Design-matrix and subject-PEB loading helpers.

Datasets

toy_dcm

Three-region single-subject DCM specification.

narps_dcm

48-subject NARPS DCM summaries used by rsdcm.

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

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

Friston, K.J., Harrison, L., 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

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]