Skip to main content
QUICK REVIEW

[Paper Review] Efficient Bayesian Structural Equation Modeling in Stan

Edgar C. Merkle, Ellen Fitzsimmons|arXiv (Cornell University)|Aug 18, 2020
Advanced Statistical Modeling TechniquesComputer Science42 references13 citations
TL;DR

This paper introduces a novel, efficient approach to Bayesian structural equation modeling (SEM) in Stan by integrating out latent variables, which dramatically improves MCMC sampling speed and efficiency compared to previous JAGS and Stan implementations. The method achieves superior performance across multiple simulation scenarios, particularly as sample size increases, due to a fixed-dimensional parameter space independent of sample size.

ABSTRACT

Structural equation models comprise a large class of popular statistical models, including factor analysis models, certain mixed models, and extensions thereof. Model estimation is complicated by the fact that we typically have multiple interdependent response variables and multiple latent variables (which may also be called random effects or hidden variables), often leading to slow and inefficient MCMC samples. In this paper, we describe and illustrate a general, efficient approach to Bayesian SEM estimation in Stan, contrasting it with previous implementations in R package blavaan (Merkle & Rosseel, 2018). After describing the approaches in detail, we conduct a practical comparison under multiple scenarios. The comparisons show that the new approach is clearly better. We also discuss ways that the approach may be extended to other models that are of interest to psychometricians.

Motivation & Objective

  • To address the inefficiency of existing MCMC-based Bayesian SEM estimation in Stan and JAGS, especially for large samples or complex models.
  • To develop a new Stan-based approach that improves sampling efficiency by marginalizing over latent variables, avoiding direct sampling of these high-dimensional parameters.
  • To enable faster and more scalable estimation of Bayesian SEMs, particularly for models with non-normal outcomes or latent variable interactions.
  • To provide a practical, open-source implementation within the blavaan R package for direct comparison with prior methods.
  • To explore the implications of prior informativeness on model covariance matrix positivity and posterior calibration in SEM MCMC sampling.

Proposed method

  • The method integrates out latent variables analytically, reducing the parameter space dimension to only the structural and measurement model parameters, thus avoiding the need to sample latent variables directly.
  • It uses the marginal likelihood of the observed data, which is multivariate normal with a mean and covariance matrix derived from the structural and measurement model parameters.
  • The approach leverages Stan’s efficient Hamiltonian Monte Carlo (HMC) sampler by expressing the joint posterior up to proportionality using the marginal likelihood and prior densities.
  • The model is coded in Stan using a reparameterization that ensures computational stability and efficient gradient-based sampling.
  • The method is contrasted with two prior approaches: one using JAGS with conditional sampling of latent variables, and another using Stan with direct latent variable sampling.
  • The implementation is integrated into the blavaan R package, allowing users to switch between methods and compare performance.

Experimental results

Research questions

  • RQ1Can integrating out latent variables in Stan significantly improve MCMC sampling efficiency for Bayesian SEM compared to conditional sampling approaches?
  • RQ2How does the performance of the new marginal approach scale with increasing sample size, especially when compared to conditional methods?
  • RQ3What is the impact of prior distributions on the positive definiteness of the model-implied covariance matrix in MCMC sampling?
  • RQ4How do the new Stan-based methods compare in speed and efficiency to the original JAGS and Stan implementations in blavaan?
  • RQ5Can the marginal approach be extended to handle non-normal observed variables, such as ordinal data, using data augmentation techniques?

Key findings

  • The new marginal Stan approach is substantially faster and more efficient than both the original JAGS and the previous Stan implementations in blavaan, with clear performance advantages across all tested scenarios.
  • Sampling efficiency remains constant with increasing sample size because the parameter space dimension is independent of sample size, unlike conditional approaches where latent variables increase dimensionality.
  • The method achieves faster convergence and more effective exploration of the posterior distribution, as evidenced by higher effective sample sizes and lower R-hat values.
  • The marginal approach enables reliable computation of information criteria like DIC and WAIC, which are essential for model comparison.
  • The use of informative priors can inadvertently induce positive definiteness in the model-implied covariance matrix, highlighting a non-intuitive interaction between prior informativeness and model identification.
  • Future extensions using data augmentation for non-normal outcomes (e.g., ordinal variables) are feasible and expected to further improve the method’s practical applicability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.