I am working with longitudinal MMRM-like Bayesian models for clinical trial data. For each patient, a continuous outcome variable is measured a pre-determined n > 2
number of times, and those outcome measurements are treated as multivariate normal for each patient. Outcomes from different patients are assumed independent conditional on the parameters.
It is common for patients to drop out during the study, so there are a lot of missing outcomes. To integrate out the missing outcomes, I am using the technique described at 3.5 Missing multivariate data | Stan User’s Guide because it works well with ELPD methods like the one by Silva and Zanella (2022). In addition, it easy to generalize to the n
-dimensional multivariate case because the marginal of a multivariate normal is multivariate normal on a subset of elements of mean vector \mu and a subset of the rows and columns of covariance matrix \Sigma. Overall, this approach works well. I am very happy with it, and it is much simpler and more computationally efficient than 3.1 Missing data | Stan User’s Guide in my case.
However, I feel like the way I am coding it is not as efficient as it could be. Each patient uses a different subset of \Sigma, and I code their likelihood in Stan as
y[subset] ~ multi_normal(mu[subset], Sigma[subset, subset])
where:
-
y
is the patient-specific vector of observations. -
mu
is the patient-specific mean vector. -
Sigma
is the shared covariance matrix among different measurements within a patient. -
subset
is a patient-specificint
array to select only the observed components ofy
.
I want to use multi_normal_cholesky()
, but subset
is different from patient to patient, and I would have to re-compute the Cholesky factor of Sigma[subset, subset]
for each patient and each MCMC iteration.
Is there a computational shortcut to compute the Cholesky factor of Sigma[subset, subset]
given an existing Cholesky factorization \Sigma = L L^T of the full covariance matrix? I tried to derive one at linear algebra - Fast shortcut to get the Cholesky factor of a submatrix - Mathematics Stack Exchange, but my answer in that post is wrong because the Cholesky-like factor I came up with is not lower triangular.