Main functions
rsdcmFit the robust and sparse group model.
rsdcm_fitAssemble group inputs from fitted DCMs.
dcm_estimateInvert a single-subject fMRI DCM.
dcm_peb_runFit the Gaussian SPM-style PEB model.
R/rsDCM.R
rsDCM-package.RdThe 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.
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.
rsdcmFit the robust and sparse group model.
rsdcm_fitAssemble group inputs from fitted DCMs.
dcm_estimateInvert a single-subject fMRI DCM.
dcm_peb_runFit the Gaussian SPM-style PEB model.
rsdcm_optionsGet or set package numerical options.
dcm_nlsi_GNVariational Laplace / Gauss-Newton inversion.
dcm_intBilinear-system integrator (forward model).
dcm_fmri_priorsConstruct fMRI DCM priors.
dcm_fx_fmri, dcm_gx_fmriNeural-state and BOLD observation equations.
dcm_bireduce, dcm_kernelsBilinear reduction and Volterra kernels.
dcm_evidence, dcm_log_evidence, dcm_log_evidence_reduceModel evidence and Bayesian model reduction.
dcm_peb_prepare, dcm_peb_runPrepare and fit a second- or third-level PEB.
dcm_peb_design, dcm_peb_files, dcm_peb_loadDesign-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.
toy_dcmThree-region single-subject DCM specification.
narps_dcmCorrected 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.
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.
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
Useful links: