1,817
Views
4
CrossRef citations to date
0
Altmetric
Teacher’s Corner

Fitting Multilevel Vector Autoregressive Models in Stan, JAGS, and Mplus

ORCID Icon, , , &
Pages 452-475 | Published online: 14 Sep 2021
 

ABSTRACT

The influx of intensive longitudinal data creates a pressing need for complex modeling tools that help enrich our understanding of how individuals change over time. Multilevel vector autoregressive (mlVAR) models allow for simultaneous evaluations of reciprocal linkages between dynamic processes and individual differences, and have gained increased recognition in recent years. High-dimensional and other complex variations of mlVAR models, though often computationally intractable in the frequentist framework, can be readily handled using Markov chain Monte Carlo techniques in a Bayesian framework. However, researchers in social science fields may be unfamiliar with ways to capitalize on recent developments in Bayesian software programs. In this paper, we provide step-by-step illustrations and comparisons of options to fit Bayesian mlVAR models using Stan, JAGS and Mplus, supplemented with a Monte Carlo simulation study. An empirical example is used to demonstrate the utility of mlVAR models in studying intra- and inter-individual variations in affective dynamics.

Acknowledgments

We would like to thank Dr. Linhai Song for permission to use his lab server as additional computational resources.

Supplementary material

Supplemental data for this article can be accessed on the publisher’s website.

Correction Statement

This article has been republished with minor changes. These changes do not impact the academic content of the article.

Notes

1 Since the data set was used only for illustration purposes, we pre-processed the raw data following the same procedure as implemented in previous studies. Other data pre-processing and exclusion criteria may be used in other studies as appropriate.

2 Extraversion was measured using three selected questions from the revised NEO personality inventory (NEO-PI-R) on which the participants were asked to rate on a 4-point scale the extent to which they felt Passive vs. Active; Unenergetic vs. Energetic; and Dominant vs. Submissive since the last time they responded to the survey.

3 Although the presented covariance matrix decomposition and the subsequent Fisher-z transformation of the correlation do not generalize to more than 2 dimensions, it was adopted in this specific context to aid computational efficiency, and to provide simple, intuitive interpretations of the effects of predictors on the person-specific correlations (see also Oravecz et al., Citation2011).

4 Note that this treatment of missing data is limited to two dimensions and do not readily generalize to higher dimensions. Such programming was implemented only to work around the restriction of handling partially observed multivariate nodes in JAGS, and is not recommended in principle.

5 With the R package, MplusAutomation, users can extract all posterior samples and include part of the first half for estimation, but caution should be taken when deciding the number of burn-in iterations to make sure that the chains are not influenced by the starting values anymore.

6 The estimated population mean of person-specific baselines of PA was calculated based on μˆ1+αˆμ1xˉ1+βˆμ1xˉ2 where xˉ1 and xˉ2 were empirical means of x1,i and x2,i across persons. Since x1,i and x2,i have been standardized to zero mean and unit variance, the estimated population mean was equal to μˆ1 (i.e., the estimate of μ1 in ). The estimated population means of other person-specific parameters were calculated in a similar way.

7 Ideally, more Monte Carlo replications need to be run to generate more reliable results. In this study, we chose 100 replications due to the high computational time. To verify that 100 replications were sufficient for the simulation purpose, we ran 500 replications with JAGS under the N = 100, T = 60, and high-stability condition, and the Monte Carlo standard error (MCSE; see EquationEquation (15)) did not change substantially compared with that with 100 replications. We note that some previous studies on Bayesian VAR models also used 100 replications (see, e.g., Huber & Feldkircher, Citation2019; Ji et al., Citation2020).

8 By checking the samplers used in JAGS, we found that when all person-specific parameters were specified to be correlated, JAGS would use an adaptive random walk Metropolis algorithm called bugs::MNormal for these correlated parameters. According to the JAGS manual, this algorithm can be very inefficient and may require an extremely long adaptation period, which has been verified by our simulation, where about 20% of the replications with JAGS did not finish the adaptation phase within 4000 iterations. In addition, we found that when only person-specific intercepts were specified to be correlated to yield a 2-dimensional covariance matrix, JAGS would use a Gibbs sampling algorithm called bugs::ConjugateMNormal, which was more efficient, as indicated by much higher ESSs.

Additional information

Funding

Research reported in this publication was supported by the Intensive Longitudinal Health Behavior Cooperative Agreement Program funded by the National Institutes of Health [U24AA027684]; National Science Foundation [IGE-1806874]. Part of the computations for this research were performed on the Pennsylvania State University’s Institute for Computational and Data Sciences’ Roar supercomputer.

Log in via your institution

Log in to Taylor & Francis Online

PDF download + Online access

  • 48 hours access to article PDF & online version
  • Article PDF can be downloaded
  • Article PDF can be printed
USD 53.00 Add to cart

Issue Purchase

  • 30 days online access to complete issue
  • Article PDFs can be downloaded
  • Article PDFs can be printed
USD 412.00 Add to cart

* Local tax will be added as applicable

Related Research

People also read lists articles that other readers of this article have read.

Recommended articles lists articles that we recommend and is powered by our AI driven recommendation engine.

Cited by lists all citing articles based on Crossref citations.
Articles with the Crossref icon will open in a new tab.