Codes for time-varying (tv) effective connectivity (ec) estimation based on P-DCM for task-fMRI [1], however can be extended to other DCMs such as S-DCM [2]. Check out the codes in the src folder.
References
[1] Havlicek, M., Roebroeck, A., Friston, K., Gardumi, A., Ivanov, D., & Uludag, K. (2015). Physiologically informed dynamic causal modeling of fMRI data. Neuroimage, 122, 355-372.
[2] Friston, K. J., Harrison, L., & Penny, W. (2003). Dynamic causal modelling. Neuroimage, 19(4), 1273-1302.