Vector Autoregressive Structure

Hello!

As part of my thesis, I conducted a mesocosm experiment using a community of organisms and we are curious about how the community we curated performed. As a part of it I am trying to fit each trophic level into a model and combine them into structural equation model. However, given that our mesocosms were measured across time, I am wanting to implement a Vector Autoregressive structure to our trophic models to see how each trophic level influences each other across time.

Is there a way to implement this using brms? I am a little new to Bayesian programming/statistics and I am coming up short in my search for solutions. Any help would be greatly appreciated!

Here is the dataset and some of the code I have been playing around with:

Additional specs:

  • Operating System: Win 11 v. 25H2
  • brms Version: 2.23.0 (on R 4.4.1)

Thank you again!

1 Like

You can do this in mvgam (Multivariate (Dynamic) Generalized Additive Models • mvgam), which handles many of the same types of effects as brms while incorporating latent time series components. See the State Space Models vignette for an example of a VAR model and how to interpret it. Some other ideas for interpretation can be found in this blog post.

2 Likes

Thank you so, so much! Seeing how this is built on brms… is there any backwards compatibility for SEM modeling? Or does the package support it itself?

Not currently, unfortunately. This may be a possibility in future versions but for now you’d have to modify the auto-generated Stan code to add this capability