I am fitting two different datasets (y_1 and y_2) that denote two different quantities (counts of cells and proportions of marker+ cells viz.), which are iid observations.
Both these quantities can be derived from the same model (M) with shared parameters, such that
How to specify this optimally in stan? How does stan handle this? Does it form a joint distribution of y_1 and y_2 while fitting the model M(\theta) simultaneously on them? Here, \theta is an array of \alpha, \beta, \text{ and } \delta.
The general practice I came across to specify this model in stan is,
Youâre just adding another multiplicative term to the joint posterior, same as if you added a prior on a parameter. It all gets multiplied together. The distributions can be completely independent, as with priors, and they wonât affect each other. If there is some connection between them, as in your example, then Stan will find the most likely values for parameters for both models in the joint posterior.
A multivariate distribution is usually something like multivariate normal where there is estimated correlation across a set of random variables. In your case, that wonât happen unless you change y1 and y2 to a vector and estimate it with MVN. The estimates can be correlated in the joint posterior, though, regardless of whether you estimate it.
I was trying to pluralize âproportional toâ, so itâs multiple proportional-to-things, just awkward notation.
Stan samples one big joint density. If you have two separate likelihoods but they share hyperparameters, the data in each likelihood informs the hyperparameters and they will have an effect on each other (thatâs just a result of Bayes rule).
There have been attempts before to try to make it so that this influence only goes one way (like one problem informs the other, but not the reverse), but thatâs not what Bayes rule says, itâs kinda weird, and Iâm not sure itâs possible to do it in Stan anyhow: https://statmodeling.stat.columbia.edu/2016/02/20/dont-get-me-started-on-cut/ (and itâs not quite the question, but itâs something you might have ended up wondering about so I wanted to give you a reference on it).