# \#multivariate-normal

**URL:** https://discourse.mc-stan.org/tag/multivariate-normal/133.md

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

---

## [Understanding group-level correlations](https://discourse.mc-stan.org/t/understanding-group-level-correlations/39748)

<div class="topic-metadata">

**Author:** [@amynang](https://discourse.mc-stan.org/u/amynang)\
**Replies:** 3\
**Last updated:** [June 20, 2025, 9:54pm UTC](https://discourse.mc-stan.org/t/understanding-group-level-correlations/39748 "2025-06-20T21:54:15Z")

</div>

I am trying to fit a multivariate nonlinear model that describes the reaction norms of phytoplankton gross photosynthesis and respiration rates to temperature. The data are rate measurements at different temperatures for…

---

## [Multivariate mixed-effect modeling](https://discourse.mc-stan.org/t/multivariate-mixed-effect-modeling/36539)

<div class="topic-metadata">

**Author:** [@morgan](https://discourse.mc-stan.org/u/morgan)\
**Replies:** 1\
**Last updated:** [September 21, 2024, 8:17am UTC](https://discourse.mc-stan.org/t/multivariate-mixed-effect-modeling/36539 "2024-09-21T08:17:12Z")

</div>

Hi all, I am attempting to use the R package “brms” to evaluate a bivariate mixed-model regression model (specifically, looking at continuous outcomes for both left and right eyes over time). In applying your model to m…

---

## [Understanding brms nested grouping term in multivariate response models](https://discourse.mc-stan.org/t/understanding-brms-nested-grouping-term-in-multivariate-response-models/32437)

<div class="topic-metadata">

**Author:** [@wpmarble](https://discourse.mc-stan.org/u/wpmarble)\
**Replies:** 4\
**Last updated:** [December 5, 2024, 7:06am UTC](https://discourse.mc-stan.org/t/understanding-brms-nested-grouping-term-in-multivariate-response-models/32437 "2024-12-05T07:06:37Z")

</div>

I’m fitting a multivariate logit response model with correlated varying intercepts using brms, following this vignette. The application is modeling multiple survey responses per respondent. I am trying to understand what…

---

## [About representing non-normal posterior distribution](https://discourse.mc-stan.org/t/about-representing-non-normal-posterior-distribution/37412)

<div class="topic-metadata">

**Author:** [@woomin](https://discourse.mc-stan.org/u/woomin)\
**Replies:** 4\
**Last updated:** [November 28, 2024, 8:19am UTC](https://discourse.mc-stan.org/t/about-representing-non-normal-posterior-distribution/37412 "2024-11-28T08:19:55Z")

</div>

Hello, thank you for click this page. I tried to analyze multivariate mixed model to gain between-subject and within-subject correlation. Below is my code: model1 ← bf(y1 ~ +x1+ (1|g|subject), family = gaussian()) mod…

---

## [Account for relationships between species in a multivariate brms model](https://discourse.mc-stan.org/t/account-for-relationships-between-species-in-a-multivariate-brms-model/32566)

<div class="topic-metadata">

**Author:** [@LukianAdams](https://discourse.mc-stan.org/u/LukianAdams)\
**Replies:** 1\
**Last updated:** [November 15, 2024, 7:12pm UTC](https://discourse.mc-stan.org/t/account-for-relationships-between-species-in-a-multivariate-brms-model/32566 "2024-11-15T19:12:10Z")

</div>

Hi all. I am currently working with a dataset containing 30 years of fish abundance for 12 fish taxa across 5 river systems, and I would like to construct joint species distribution models to determine where artificial b…

---

## [Pointwise log lik for multi-response Poisson model](https://discourse.mc-stan.org/t/pointwise-log-lik-for-multi-response-poisson-model/37191)

<div class="topic-metadata">

**Author:** [@Erik\_Ringen](https://discourse.mc-stan.org/u/Erik_Ringen)\
**Replies:** 6\
**Last updated:** [November 14, 2024, 7:47am UTC](https://discourse.mc-stan.org/t/pointwise-log-lik-for-multi-response-poisson-model/37191 "2024-11-14T07:47:08Z")

</div>

Consider a multiresponse (i.e., multivariate) model with correlations between responses j \\in J captured by correlated observation-level random effects \\nu, and a Poisson observation model for each response. y\_{i,j} \\si…

---

## [Residual correlation of multivariate model for binary response variable](https://discourse.mc-stan.org/t/residual-correlation-of-multivariate-model-for-binary-response-variable/36745)

<div class="topic-metadata">

**Author:** [@Emma0305](https://discourse.mc-stan.org/u/Emma0305)\
**Replies:** 0\
**Last updated:** [September 27, 2024, 11:00am UTC](https://discourse.mc-stan.org/t/residual-correlation-of-multivariate-model-for-binary-response-variable/36745 "2024-09-27T11:00:24Z")

</div>

Hi all, I’m working on a multivariate model that involves a continuous response variable (nicheScore) and a binary response variable (PLBin). My goal is to estimate the residual correlation between these two responses. …

---

## [Constrain intercepts and/or standard deviations to be the same for all variables in brms multivariate response model?](https://discourse.mc-stan.org/t/constrain-intercepts-and-or-standard-deviations-to-be-the-same-for-all-variables-in-brms-multivariate-response-model/36564)

<div class="topic-metadata">

**Author:** [@qdread](https://discourse.mc-stan.org/u/qdread)\
**Replies:** 0\
**Last updated:** [September 11, 2024, 7:43pm UTC](https://discourse.mc-stan.org/t/constrain-intercepts-and-or-standard-deviations-to-be-the-same-for-all-variables-in-brms-multivariate-response-model/36564 "2024-09-11T19:43:00Z")

</div>

I have put together a model in brms to deal with a kind of esoteric situation. I am modeling the relationship between a phenotype (continuous outcome) and some microbiome data, at the seed level. There are repeated measu…

---

## [Plotting both responses of a multivariate regression in the same graph with brms](https://discourse.mc-stan.org/t/plotting-both-responses-of-a-multivariate-regression-in-the-same-graph-with-brms/36511)

<div class="topic-metadata">

**Author:** [@Kostasp](https://discourse.mc-stan.org/u/Kostasp)\
**Replies:** 2\
**Last updated:** [September 6, 2024, 10:48pm UTC](https://discourse.mc-stan.org/t/plotting-both-responses-of-a-multivariate-regression-in-the-same-graph-with-brms/36511 "2024-09-06T22:48:59Z")

</div>

Hi all, I’m fitting the below multivariate model: bfLSI2\<-bf(logLSI~1+ZHIP+GHQ\_28\_total\_cat) bfFSFI1\<-bf(logFSFI~1+ZHIP) fit21\<-brm(bfLSI2 + bfFSFI1 + set\_rescor(TRUE), data=Dataset, prior=prior1, iter=4000, warmup=150…

---

## [Trouble recreating SUG MVN prior example](https://discourse.mc-stan.org/t/trouble-recreating-sug-mvn-prior-example/35763)

<div class="topic-metadata">

**Author:** [@jacollings](https://discourse.mc-stan.org/u/jacollings)\
**Replies:** 4\
**Last updated:** [July 5, 2024, 8:06pm UTC](https://discourse.mc-stan.org/t/trouble-recreating-sug-mvn-prior-example/35763 "2024-07-05T20:06:55Z")

</div>

Hiya folks. I’ve been trying to better understand the use of the MVN distribution for priors in a hierarchical model. Ultimately, I’m hoping to develop models with MVN priors on regression coefficients and covariance pri…

---

## [Help with Multivariate Autoregressive Model with random effects](https://discourse.mc-stan.org/t/help-with-multivariate-autoregressive-model-with-random-effects/34935)

<div class="topic-metadata">

**Author:** [@matheusbarrosb](https://discourse.mc-stan.org/u/matheusbarrosb)\
**Replies:** 2\
**Last updated:** [April 26, 2024, 8:53pm UTC](https://discourse.mc-stan.org/t/help-with-multivariate-autoregressive-model-with-random-effects/34935 "2024-04-26T20:53:40Z")

</div>

Hello all, I have been trying to fit a spatially-explicit Multivariate Autoregressive Model of order P with covariates and random effects to model recruitment time series for several species. The model has the following…

---

## [Issues sampling from multivariate normal prior](https://discourse.mc-stan.org/t/issues-sampling-from-multivariate-normal-prior/33930)

<div class="topic-metadata">

**Author:** [@ischmidt20](https://discourse.mc-stan.org/u/ischmidt20)\
**Replies:** 11\
**Last updated:** [January 29, 2024, 2:53pm UTC](https://discourse.mc-stan.org/t/issues-sampling-from-multivariate-normal-prior/33930 "2024-01-29T14:53:48Z")

</div>

Hello, I am trying to fit a Poisson regression in Stan, through brms in R. My prior is specified as a multivariate normal distribution, with non-zero mean, and non-zero correlations between different variables. I have …

---

## [Brms: Estimating residual correlation between two variables with measurement error](https://discourse.mc-stan.org/t/brms-estimating-residual-correlation-between-two-variables-with-measurement-error/33356)

<div class="topic-metadata">

**Author:** [@tomkeaney](https://discourse.mc-stan.org/u/tomkeaney)\
**Replies:** 1\
**Last updated:** [December 11, 2023, 5:01am UTC](https://discourse.mc-stan.org/t/brms-estimating-residual-correlation-between-two-variables-with-measurement-error/33356 "2023-12-11T05:01:15Z")

</div>

I have a model that attempts to estimate the residual correlation between two traits using the brms multivariate syntax, where both traits are measured with some error. Testing with some simulated data, the model without…

---

## [Multivariate model to understand effect of different datasets using the same model formula](https://discourse.mc-stan.org/t/multivariate-model-to-understand-effect-of-different-datasets-using-the-same-model-formula/33282)

<div class="topic-metadata">

**Author:** [@tester](https://discourse.mc-stan.org/u/tester)\
**Replies:** 0\
**Last updated:** [November 9, 2023, 5:22pm UTC](https://discourse.mc-stan.org/t/multivariate-model-to-understand-effect-of-different-datasets-using-the-same-model-formula/33282 "2023-11-09T17:22:19Z")

</div>

I am working on a model that should help me understand the differences between three similar datasets collected in different environments (E1, E2, E3). All three datasets contain repetitions from participants according t…

---

## [Multiple-outcome causal model in brms](https://discourse.mc-stan.org/t/multiple-outcome-causal-model-in-brms/28512)

<div class="topic-metadata">

**Author:** [@tester](https://discourse.mc-stan.org/u/tester)\
**Replies:** 3\
**Last updated:** [March 6, 2023, 7:50pm UTC](https://discourse.mc-stan.org/t/multiple-outcome-causal-model-in-brms/28512 "2023-03-06T19:50:49Z")

</div>

I would like to fit a multivariate causal model in brms, according to the following hypothesized DAG: Through the model, I want to understand the total effect of the treatment a on both outcomes y1 and y2, while takin…

---

## [Tips for efficiency using a multivariate normal on a hidden markov model](https://discourse.mc-stan.org/t/tips-for-efficiency-using-a-multivariate-normal-on-a-hidden-markov-model/28674)

<div class="topic-metadata">

**Author:** [@ramiro](https://discourse.mc-stan.org/u/ramiro)\
**Replies:** 4\
**Last updated:** [August 30, 2022, 8:42pm UTC](https://discourse.mc-stan.org/t/tips-for-efficiency-using-a-multivariate-normal-on-a-hidden-markov-model/28674 "2022-08-30T20:42:10Z")

</div>

I would like to fit the following model using a multivariate normal, it is a Hidden Markov Model where we know the latent states. We have the following observations x\_{1,s(1)}, \\ldots, x\_{n,s(n)} where x\_{i,s(i)} corr…

---

## [Comparing Wishart prior against LKJ prior](https://discourse.mc-stan.org/t/comparing-wishart-prior-against-lkj-prior/28053)

<div class="topic-metadata">

**Author:** [@Kat](https://discourse.mc-stan.org/u/Kat)\
**Replies:** 5\
**Last updated:** [July 4, 2022, 8:46am UTC](https://discourse.mc-stan.org/t/comparing-wishart-prior-against-lkj-prior/28053 "2022-07-04T08:46:29Z")

</div>

I am trying to fit a 3-dimensional multivariate normal model, assuming either Wishart or LKJ prior for covariance matrix, I chose standard choices of hyperparameters for those, which are nu = 4, and Sigma = diag(3) for W…

---

## [Un-vectorizing a multinormal model results in non-convergence](https://discourse.mc-stan.org/t/un-vectorizing-a-multinormal-model-results-in-non-convergence/27769)

<div class="topic-metadata">

**Author:** [@jerome](https://discourse.mc-stan.org/u/jerome)\
**Replies:** 1\
**Last updated:** [June 9, 2022, 1:15pm UTC](https://discourse.mc-stan.org/t/un-vectorizing-a-multinormal-model-results-in-non-convergence/27769 "2022-06-09T13:15:10Z")

</div>

I am experimenting with fitting data to a multi-normal model. I used Jake Ying’s example code as a starting point. Here’s the R code: N \<- 100 mu \<- c(1, 2, -5) # means Q \<- matrix(c(1, 0.7, 0.2, # correlation matrix (…

---

## [Multivariate probit model, use of sufficient statistics](https://discourse.mc-stan.org/t/multivariate-probit-model-use-of-sufficient-statistics/27108)

<div class="topic-metadata">

**Author:** [@edm](https://discourse.mc-stan.org/u/edm)\
**Replies:** 3\
**Last updated:** [April 25, 2022, 5:23pm UTC](https://discourse.mc-stan.org/t/multivariate-probit-model-use-of-sufficient-statistics/27108 "2022-04-25T17:23:54Z")

</div>

Hi all, I have a question related to the multivariate probit example at the bottom of this page. That example uses the Albert-Chib method to generate continuous z variables underlying the binary responses. Say that we h…

---

## [Reduce\_sum parallelisation issue](https://discourse.mc-stan.org/t/reduce-sum-parallelisation-issue/26545)

<div class="topic-metadata">

**Author:** [@andrea](https://discourse.mc-stan.org/u/andrea)\
**Replies:** 12\
**Last updated:** [February 24, 2022, 7:27pm UTC](https://discourse.mc-stan.org/t/reduce-sum-parallelisation-issue/26545 "2022-02-24T19:27:07Z")

</div>

Hi, first of all thanks for all your work. I have a question regarding within-chain parallelisation using the function reduce\_sum because I see a really strange behaviour, as the model with parallelisation is much slowe…

---

## [Setting response-specific priors in a multivariate model throws errors if response column name contains an underscore](https://discourse.mc-stan.org/t/setting-response-specific-priors-in-a-multivariate-model-throws-errors-if-response-column-name-contains-an-underscore/26407)

<div class="topic-metadata">

**Author:** [@alex.b.r](https://discourse.mc-stan.org/u/alex.b.r)\
**Replies:** 0\
**Last updated:** [February 17, 2022, 3:13pm UTC](https://discourse.mc-stan.org/t/setting-response-specific-priors-in-a-multivariate-model-throws-errors-if-response-column-name-contains-an-underscore/26407 "2022-02-17T15:13:09Z")

</div>

I am able to set response-specific sd and sigma priors for a multivariate model, but only if the name of the response column does not contain an underscore. I first encountered this working with data I can’t share, but …

---

## [Simulation-based validation of sampling designs and prediction models for environmental monitoring](https://discourse.mc-stan.org/t/simulation-based-validation-of-sampling-designs-and-prediction-models-for-environmental-monitoring/26076)

<div class="topic-metadata">

**Author:** [@potash](https://discourse.mc-stan.org/u/potash)\
**Replies:** 0\
**Last updated:** [January 24, 2022, 5:17pm UTC](https://discourse.mc-stan.org/t/simulation-based-validation-of-sampling-designs-and-prediction-models-for-environmental-monitoring/26076 "2022-01-24T17:17:52Z")

</div>

I just finally published my first two articles with Stan! Both model the latent ground truth of an environmental variable in the context of high measurement/sampling variability. Then they do what I’m calling simulation-…

---

## [Multilevel model with responses on different levels?](https://discourse.mc-stan.org/t/multilevel-model-with-responses-on-different-levels/25000)

<div class="topic-metadata">

**Author:** [@ljwolf](https://discourse.mc-stan.org/u/ljwolf)\
**Replies:** 1\
**Last updated:** [November 4, 2021, 11:26am UTC](https://discourse.mc-stan.org/t/multilevel-model-with-responses-on-different-levels/25000 "2021-11-04T11:26:46Z")

</div>

I’m seeking to fit a model where I have information recorded at two separate levels in a hierarchy. My hope is that including the second response allows for better convergence than just using the group mean. The specific…

---

## [Two-level correlation matrix reparametrization](https://discourse.mc-stan.org/t/two-level-correlation-matrix-reparametrization/24994)

<div class="topic-metadata">

**Author:** [@Stepan\_Aleshin](https://discourse.mc-stan.org/u/Stepan_Aleshin)\
**Replies:** 1\
**Last updated:** [October 26, 2021, 1:49pm UTC](https://discourse.mc-stan.org/t/two-level-correlation-matrix-reparametrization/24994 "2021-10-26T13:49:54Z")

</div>

I have the two level data, where variables have some group independent correlations, and, additionally, group means are also correlated. Below you will find my R code to simulate such kind of the data: When including S…

---

## [Modeling Multivariate Normal Variance-Covariance](https://discourse.mc-stan.org/t/modeling-multivariate-normal-variance-covariance/24450)

<div class="topic-metadata">

**Author:** [@Jacob\_Warren](https://discourse.mc-stan.org/u/Jacob_Warren)\
**Replies:** 4\
**Last updated:** [September 29, 2021, 11:23am UTC](https://discourse.mc-stan.org/t/modeling-multivariate-normal-variance-covariance/24450 "2021-09-29T11:23:43Z")

</div>

I’m wondering if there’s a better way to specify the following model. I’d like to model the variance-covariance matrices based on the model matrix. Right now, the only way I’m able to get this to work is to sort the matr…

---

## [GP with Multiple input and single output](https://discourse.mc-stan.org/t/gp-with-multiple-input-and-single-output/24498)

<div class="topic-metadata">

**Author:** [@mmabaei](https://discourse.mc-stan.org/u/mmabaei)\
**Replies:** 2\
**Last updated:** [September 21, 2021, 7:57am UTC](https://discourse.mc-stan.org/t/gp-with-multiple-input-and-single-output/24498 "2021-09-21T07:57:51Z")

</div>

Hi Fellows, I am interested in learning GP with multiple input, however i could not find any relevant documents or examples thay was done by stan to help me the concepts behind. I am wondering if anyone across with such…

---

## [Stability of random effects across waves](https://discourse.mc-stan.org/t/stability-of-random-effects-across-waves/22289)

<div class="topic-metadata">

**Author:** [@Nic](https://discourse.mc-stan.org/u/Nic)\
**Replies:** 2\
**Last updated:** [May 11, 2021, 1:15pm UTC](https://discourse.mc-stan.org/t/stability-of-random-effects-across-waves/22289 "2021-05-11T13:15:16Z")

</div>

Hi all, I aim to investigate stabilities of random effects (specifically random slopes) across waves of data collection. I was wondering if this was possible using multivariate brms models. Specifically, it would be de…

---

## [Multivariate normal CDF](https://discourse.mc-stan.org/t/multivariate-normal-cdf/21702)

<div class="topic-metadata">

**Author:** [@Jonathan](https://discourse.mc-stan.org/u/Jonathan)\
**Replies:** 4\
**Last updated:** [April 7, 2021, 9:46am UTC](https://discourse.mc-stan.org/t/multivariate-normal-cdf/21702 "2021-04-07T09:46:41Z")

</div>

Hi all, I need to use the 10 dimensional normal CDF inside Stan. Given that Stan only officially supports the one-dimensional normal CDF, I wonder what my options are? E.g., is numerical integration possible for my pur…

---

## [How to use matrix normal distribution in Stan?](https://discourse.mc-stan.org/t/how-to-use-matrix-normal-distribution-in-stan/20112)

<div class="topic-metadata">

**Author:** [@carlos\_perez](https://discourse.mc-stan.org/u/carlos_perez)\
**Replies:** 3\
**Last updated:** [January 10, 2021, 7:55am UTC](https://discourse.mc-stan.org/t/how-to-use-matrix-normal-distribution-in-stan/20112 "2021-01-10T07:55:03Z")

</div>

kind regards, I have a response variable with the following dimensions: data { int N; // number of observations. int K; // number of locations. int R; // number of sensors at each location. matrix\[R, K\] y\[N\]; } I wa…

---

## [Multivariate normal data with Bayesian Lasso to do variable selection](https://discourse.mc-stan.org/t/multivariate-normal-data-with-bayesian-lasso-to-do-variable-selection/19502)

<div class="topic-metadata">

**Author:** [@tsuli](https://discourse.mc-stan.org/u/tsuli)\
**Replies:** 2\
**Last updated:** [November 29, 2020, 8:28pm UTC](https://discourse.mc-stan.org/t/multivariate-normal-data-with-bayesian-lasso-to-do-variable-selection/19502 "2020-11-29T20:28:49Z")

</div>

Hi, I am university student learning Bayesian statistics currently, and I am a first time user here. I would like to ask some support, please. I intend to create a model for variable selection using Bayesian Lasso appr…

[Next page](https://discourse.mc-stan.org/tag/multivariate-normal/133.md?match_all_tags=true&page=1&tags%5B%5D=multivariate-normal)
