Dynamic Structural Equation Modeling: A Tutorial Using Stan

Dynamic structural equation modeling (DSEM) has become a central tool for analyzing intensive longitudinal data, such as data from ecological momentary assessment and daily diary studies. In practice, DSEM is almost exclusively estimated in Mplus, a commercial, closed-source program, while packages built on the open-source probabilistic programming language Stan offer only a fixed selection of models. This tutorial shows applied researchers how to implement DSEM directly in Stan. Starting from a bivariate multilevel cross-lagged model with random effects, we build the model in three steps: a minimal working version, a non-centered reparameterization that resolves the convergence problems of the first version, and an extension that treats missing observations as parameters to be estimated. Along the way, we explain how to read Stan's convergence and sampler diagnostics, how to inspect the results visually, and how to report a Bayesian DSEM. On simulated data with known parameter values, the Stan implementation recovers the true values and closely reproduces the estimates of Mplus and of the R package mlts. We then demonstrate the flexibility of working in Stan with two extensions that require only local changes to the code: residual DSEM, and a binary within-person predictor, illustrated with data from a micro-randomized mindfulness intervention. All code is openly available and written to be adapted to new models. Working directly in Stan requires more initial effort than Mplus, but it makes every modeling decision transparent and extensible, and it lets researchers fit the model their research question calls for.

Authors

Publication Details

Published
2026-10-31
DOI
https://doi.org/10.31234/osf.io/qw547_v1
Primary Topic
Statistical Methods and Bayesian Inference
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Dynamic Structural Equation Modeling: A Tutorial Using Stan

Jean-Paul Snijder, Andreas B. Neubauer, Anna‐Lena Schubert
Statistical Methods and Bayesian Inference
preprint

Dynamic Structural Equation Modeling: A Tutorial Using Stan

Jean-Paul Snijder, Andreas B. Neubauer, Anna‐Lena Schubert
preprint en

Abstract

Dynamic structural equation modeling (DSEM) has become a central tool for analyzing intensive longitudinal data, such as data from ecological momentary assessment and daily diary studies. In practice, DSEM is almost exclusively estimated in Mplus, a commercial, closed-source program, while packages built on the open-source probabilistic programming language Stan offer only a fixed selection of models. This tutorial shows applied researchers how to implement DSEM directly in Stan. Starting from a bivariate multilevel cross-lagged model with random effects, we build the model in three steps: a minimal working version, a non-centered reparameterization that resolves the convergence problems of the first version, and an extension that treats missing observations as parameters to be estimated. Along the way, we explain how to read Stan's convergence and sampler diagnostics, how to inspect the results visually, and how to report a Bayesian DSEM. On simulated data with known parameter values, the Stan implementation recovers the true values and closely reproduces the estimates of Mplus and of the R package mlts. We then demonstrate the flexibility of working in Stan with two extensions that require only local changes to the code: residual DSEM, and a binary within-person predictor, illustrated with data from a micro-randomized mindfulness intervention. All code is openly available and written to be adapted to new models. Working directly in Stan requires more initial effort than Mplus, but it makes every modeling decision transparent and extensible, and it lets researchers fit the model their research question calls for.

Statistical Methods and Bayesian Inference
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
Dynamic Structural Equation Modeling: A Tutorial Using Stan — Jean-Paul Snijder, Andreas B. Neubauer, et al. · (2026) | TGRS Research Map | TGRS