A Hybrid NUTS-Gibbs Sampler with State Space Marginalization for Estimation of Dynamic Structural Equation Models with Binomial Outcomes
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Statistics. The day in statistics: methods, theory and the inference under them.
Tom: I'm Tom.
Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.
Tom: We're looking at the paper: "A Hybrid NUTS-Gibbs Sampler with State Space Marginalization for Estimation of Dynamic Structural Equation Models with Binomial Outcomes".
Jane: Here's the gist of the paper. Dynamic structural equation modeling (DSEM) is widely used for analyzing intensive longitudinal data (ILD), and this paper presents a hybrid sampler that solves problems with current Metropolis-within-Gibbs samplers when dealing with binomial outcomes.
Tom: Addressing Computational Bottlenecks The proposed hybrid sampler alternates between one step of the No-U-Turn Sampler (NUTS) and one Gibbs step to solve issues related to scaling with model complexity and data size.
Jane: The NUTS step utilizes a Kalman filter to exactly marginalize over latent states, which alleviates the need to sample these variables.
Tom: This approach allows the sampler to target a marginal posterior with O (N + T) parameters instead of O (N · T) as would otherwise be the case.
Paper summary: Tom: So, wrapping up this paper "A Hybrid NUTS-Gibbs Sampler with State Space Marginalization for Estimation of Dynamic Structural Equation Models with Binomial Outcomes," the main thing is that they’ve built a sampler that combines the power of NUTS and Gibbs sampling to handle binomial data better than previous methods.
Jane: It’s about making dynamic structural equation modeling more practical when dealing with categorical responses, specifically binary ones, which is where many real-world longitudinal studies fall >
Lu: The implication is that researchers can now tackle more complex models involving time and multiple participants without immediately being bottlenecked by the parameter space size as much as they were before >
Meng: For deploying these models in a production setting, this hybrid sampler offers a path to running them on larger participant pools because the parameter scaling gets better than O N times T >
Lalam: The paper demonstrates that this approach is more efficient than alternative algorithms for estimating binomial-response DSEMs, especially when looking at AR one models with participant-invariant dynamics >
Tom: That’s the takeaway: they solved a computational bottleneck by cleverly mixing a standard sampler with a marginalization technique to manage those latent states >
Jane: And while they point out that it struggles more with ordinal or negative binomial data, the core contribution is showing how to make this framework work for binomial data in a scalable way >
Conclusion: Tom: So we're wrapping up this look at "A Hybrid NUTS-Gibbs Sampler with State Space Marginalization for Estimation of Dynamic Structural Equation Models with Binomial Outcomes." Essentially, the authors built a sampler that mixes two different ways of sampling to handle dynamic models where the data is binary.
Jane: That means they took a standard, very popular tool called NUTS and gave it a little boost by adding Gibbs steps. The goal was to solve problems when you have lots of participants and lots of time points in your data.
Lu: The core idea here is using something called state space marginalization inside the NUTS step. That lets them ignore sampling all those hidden variables, which cuts down the number of parameters they actually have to worry about.
Meng: From a production standpoint, that’s good because it means you don't have to deal with parameter scaling that goes up with both your model complexity and how much data you collect over time. You can handle more scale.
Lalam: I agree, the authors show this sampler is actually more efficient than just using pure NUTS for binomial responses, especially in those AR one models they tested. The results show a real efficiency gain there.
Tom: It’s interesting how they handle different data types too, supporting both logit and probit links depending on whether the data is binomial or not. That flexibility is key when you're trying to apply this across different fields like psychology or epidemiology.
Jane: But it’s important to remember what they *don't* do well. They admit that for ordinal responses, updating the threshold parameters in the Gibbs step gets really messy and creates chains that don't mix well.
Lu: And they also found it struggles with negative binomial data because NUTS just isn't set up right to handle those discrete parameters like a dispersion value. That’s a clear limitation they put on the scope of the sampler.
Meng: So, while this is great for binary data in complex dynamic settings, you can't just throw it at any kind of statistical problem without checking those limitations first. It’s specialized efficiency.
Lalam: Exactly; it's a very powerful tool for its specific job, but it doesn't solve every sampling headache out there. So, the big question is how much more complex of data can we feed this sampler before we have to switch gears?
Øystein Sørensen, Ethan M. McCormick
Department of Psychology, University of Oslo · Educational Statistics and Research Methods, School of Education, University of Delaware · Methodology & Statistics Department, Institute of Psychology, Leiden University
stat.CO, stat.ME
Submitted: 2026-03-31
Updated: 2026-11-16
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 80/100
The gist: Dynamic structural equation modeling (DSEM) is widely used for analyzing intensive longitudinal data (ILD)…
Key concepts
- Dynamic Structural Equation Modeling (DSEM)
- This is a statistical framework used to analyze data that changes over time, such as repeated measurements on the same individuals. It helps researchers model complex relationships between different variables that evolve across multiple time points.
- No-U-Turn Sampler (NUTS)
- NUTS is an advanced Markov Chain Monte Carlo algorithm used for sampling from complex probability distributions. In this context, it uses a Kalman filter to efficiently marginalize over latent (unobserved) states, significantly reducing the computational load compared to traditional methods.
- Hybrid Sampler
- This approach alternates between two different sampling strategies: one step of NUTS and one Gibbs step. This combination is designed to solve computational bottlenecks when dealing with binomial data, balancing the efficiency of both methods.
Terminology
Summary
Dynamic structural equation modeling (DSEM) is widely used for analyzing intensive longitudinal data (ILD), and this paper presents a hybrid sampler that solves problems with current Metropolis-within-Gibbs samplers when dealing with binomial outcomes. p. 0 A Hybrid NUTS-Gibbs Sampler with State Space
Marginalization for Estimation of Dynamic Structural
Equation Models with Binomial Outcomes
Øystein Sørensen1
and Ethan M. McCormick2,3
1Department of Psychology, University of Oslo, Oslo, Norway
2Educational Statistics and Research Methods, School of Education,
University of Delaware, Newark, Delaware, USA
3Methodology & Statistics Department, Institute of Psychology, Leiden
University, Leiden, Netherlands
Abstract
Dynamic structural equation modeling (DSEM) is widely used for analyzing intensive
longitudinal data (ILD).Where the paper says it
Addressing Computational Bottlenecks
The proposed hybrid sampler alternates between one step of the No-U-Turn Sampler (NUTS) and one Gibbs step to solve issues related to scaling with model complexity and data size. The NUTS step utilizes a Kalman filter to exactly marginalize over latent states, which alleviates the need to sample these variables. p. 0 These samplers
scale poorly with increasing model complexity and/or data size. Here, we present a
hybrid sampler—alternating between one step of the No-U-Turn Sampler (NUTS) and
one Gibbs step—which solves both of these problems: the Gibbs step naturally handles
Pólya-Gamma distributed latent variables arising from binomially distributed responses
with a logit link, and the NUTS step utilizes a Kalman filter to exactly marginalize over
latent states, alleviating the need to sample these variables. This allows
marginalizing out the within-level latent variables 𝜼1,𝑖𝑡 analytically using a Kalman filter, alleviating the need to sample them. This approach, however, requires a conditionally Gaussian
measurement model. In the Gibbs step, latent responses are then sampled
conditionally on all other model parameters. The number of parameters to be sampled in
each iteration is still O (𝑁 · 𝑇), but the computationally demanding NUTS step samples only
O (𝑁 + 𝑇) parameters while the O (𝑁 · 𝑇) latent responses are sampled in a single highly
parallelizable Gibbs step.Where the paper says it
Where the paper says it
Where the paper says it
Handling Different Response Types
The algorithm supports both binomially distributed data with the logit link using Pólya-Gamma distributed latent variables and the probit link using truncated normal latent variables. For binomial data, the logit link employs Pólya-Gamma auxiliary variables drawn from a Pólya-Gamma distribution conditioned on the total linear predictor. p. 4 For binomial data where 𝑦𝑖𝑡 𝑗 represents the number of successes in 𝑛𝑖𝑡 𝑗 trials—with the
Bernoulli distribution corresponding to the special case 𝑛𝑖𝑡 𝑗 = 1—we first define the shifted
response 𝜅𝑖𝑡 𝑗 = 𝑦𝑖𝑡 𝑗 − 𝑛𝑖𝑡 𝑗/2. Next, for each observation we introduce the auxiliary random
variable 𝜔𝑖𝑡 𝑗 drawn from a Pólya-Gamma distribution conditioned on the total linear predictor
defined in (2. , 2013) and the probit link using truncated
normal latent variables (Albert & Chib, 1993). To the best of our knowledge, estimation of
DSEMs with binomial data using the Pólya-Gamma distribution has not been discussed in the
literature, but particularly with binomial observations based on multiple trials, this is a more
efficient approach than using truncated normals, which requires either new latent variables or
2Where the paper says it
Where the paper says it
Efficiency Gains in Simulation
Simulation experiments demonstrate that the proposed sampler is more efficient than alternative algorithms for estimating binomial-response DSEMs. For the AR(1) model with participant-invariant dynamics, the hybrid sampler dominated all other algorithms for all conditions considered. p. 8 2) and compared the
efficiency of the proposed hybrid NUTS-Gibbs sampler to alternative algorithms, as described
next. 1 Participant-Invariant Dynamics
First, we let the dynamics be participant-invariant, by fixing 𝜙 = 0.Where the paper says it
Limitations and Future Directions
The hybrid sampler is less efficient for ordinal responses because updating threshold parameters in the Gibbs step leads to highly auto-correlated chains. Similarly, it is inefficient for negative binomial responses because NUTS cannot efficiently handle discrete parameters like the dispersion parameter. p. 2 In Section 5 we show simulation experiments for various DSEMs with binomial
responses, comparing the NUTS-Gibbs sampler to alternative algorithms and in Section 6 we
show an example application where we analyze an ecological momentary assessment dataset
with a mix of binomial and continuous observations. In Section 7 we demonstrate why the
proposed hybrid sampler is inefficient for ordinal and negative binomially distributed responses,
and in Section 8 we discuss a number of interesting opportunities for further improvements in
DSEM estimation. To this end, we propose a hybrid NUTS-Gibbs algorithm. In the NUTS step, the sampler
uses HMC through the No-U-Turn Sampler (NUTS) (Hoffman & Gelman, 2014) combined
with marginalization of within-level latent states through a Kalman filter exactly as in Sørensen
(2026), but conditional on latent responses. , 𝐾,
will eventually be arbitrarily close to being a sample from the true posterior distribution. The sampling step 3(i) and the Kalman filter operation in step 4(i) can be parallelized across
participants but not across timepoints, due to the temporal autocorrelation in (3.Where the paper says it
Where the paper says it
Where the paper says it
Application Example
An application example analyzing a dataset from Jang et al. (2024) showed that the hybrid NUTS-Gibbs sampler, run for 8,000 iterations on each of four parallel chains, took slightly less than 2 hours. p. 8 All algorithms were run with four parallel chains. The length of the warm-up phases
for each algorithm and condition were chosen through initial pilot runs, and the total number
of iterations was set long enough to ensure reliable estimation of the effective sampling rate
and a sufficiently high bulk-ESS to ensure that the algorithms converged towards the correct
posterior. We demonstrate in simulation
experiments that the proposed sampler is more efficient than alternative algorithms, and
that it makes DSEM estimation with binomial data feasible for larger data and models than
what has previously been possible. We also illustrate its use in an example application of
predicting panic attacks.Where the paper says it
Where the paper says it
Discussion on Parallelization
The algorithm is efficient because both the Kalman filter inside the NUTS step and the Gibbs step can be performed independently across participants but not across timepoints. NumPyro uses the XLA compiler to efficiently vectorize these operations across the N participants in each chain. p. 7 We hence used NumPyro, which is based on the just-in-time (JIT) compiler JAX (Frostig
et al. , 2019) and uses NUTS with an iterative rather than recursive tree-building algorithm (Phan
et al. (2013) show
how Pólya-Gamma distributed random variables can be efficiently obtained with a rejection
sampler whose probability of acceptance is uniformly bounded below at 0. For binomial data where 𝑦𝑖𝑡 𝑗 represents the number of successes in 𝑛𝑖𝑡 𝑗 trials—with the
Bernoulli distribution corresponding to the special case 𝑛𝑖𝑡 𝑗 = 1—we first define the shifted
response 𝜅𝑖𝑡 𝑗 = 𝑦𝑖𝑡 𝑗 − 𝑛𝑖𝑡 𝑗/2.Where the paper says it
Where the paper says it
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Hybrid NUTS-Gibbs Sampler for DSEM Estimation: The proposed algorithm improves efficiency by alternating between a No-U-Turn Sampler (NUTS) step that uses HMC with Kalman filter marginalization to target a marginal posterior with O (N + T) parameters, and a Gibbs step that samples the O (N · T) latent responses in parallel. This allows DSEM estimation with binomial data to be feasible for larger data and models than previously possible by exploiting NUTS' ability to efficiently explore high-dimensional parameter spaces with the speed of the parallelized Gibbs sampler.
-
Handling Binomial Outcomes: The sampler supports both the probit link through latent Gaussian responses and the logit link through Pólya-Gamma auxiliary variables, providing a more efficient approach than using truncated normals or Bernoulli trials for binomial observations based on multiple trials. This capability extends DSEM estimation to data types common in educational technology and cognitive testing.
-
State Space Formulation for Discrete Responses: The within-level model of the DSEM is reformulated as a linear Gaussian state space model (LG-SSM) using data augmentation, which maps discrete observations to continuous, conditionally Gaussian pseudo-observations. This allows for the exact marginalization of within-level latent variables analytically using a Kalman filter, even when responses are not conditionally Gaussian.
-
Scalability and Parallelization: The algorithm is designed such that
all participants can be treated completely independently
in the Gibbs step, making it an ideal case for parallelization when the number of participants is large. Furthermore, "the temporal parallelization algorithm of Särkkä and García-Fernández (2021) could potentially reduce the time required for running the Kalman filter for each individual participant from O (T) for the algorithm outlined in Section 4.1 to O (log T)." -
Application in Predictive Modeling: The system can be used to predict events, such as panic attacks, by modeling them with a Bernoulli distribution linked via an inverse logit function on the linear predictor, incorporating continuous measurements like heart rate and step count.
Abstract
Dynamic structural equation models (DSEMs) are widely used for analyzing intensive longitudinal data (ILD). Although many ILD have categorical (Bernoulli or binomially distributed) responses, currently available algorithms for estimating DSEMs are limited to using the probit link and the Bernoulli distribution, i.e., the response can only be success or failure for a single trial and not the number of successes in multiple trials. They also scale poorly with increasing model complexity and sample size. Here, we present a hybrid sampler---alternating between one step of the No-U-Turn Sampler (NUTS) and one Gibbs step---which solves both of these problems: the Gibbs step naturally handles Pólya-Gamma distributed latent variables arising from binomially distributed responses with a logit link, and the NUTS step utilizes a Kalman filter to exactly marginalize over latent states, making models with dynamics defined in terms of latent traits more computationally feasible. We demonstrate the efficiency of the proposed sampler in simulation experiments, and also study conditions under which it fails. We finally illustrate its use in an example application of predicting panic attacks.
Sources
- A Conceptual Introduction to Hamiltonian Monte Carlo
- Composable Effects for Flexible and Accelerated Probabilistic Programming in NumPyro
- Efficient Bayesian Estimation of Dynamic Structural Equation Models via State Space Marginalization
Related papers
- Sticky Manifold Piecewise Deterministic Monte Carlo for Bayesian Model Averaging
- A perturbation theory for Feynman-Kac models and their particle interpretations
- Fast Functional Clustering via Closed-Form Covariance Updates
- A fast non-reversible sampler for Bayesian mixture models
- Inventory and Assortment Optimization under General Choice: A Unified Approximation Framework
- Least squares variational inference