Marginal within-biomarker variance under the factor model
Source:R/marginal_var_2a.R
marginal_var_2a.RdThe Model 2a factor construction is
par[i,k,p] = mu[k,p] + w[i,k,p] + lambda[k,p] * f[i,p], so the marginal
variance of parameter p for biomarker k is the within-biomarker variance
of w plus the squared loading:
$$\mathrm{Var}(par_{k,p}) = (\mathrm{prec.par}_k^{-1})_{pp} +
\lambda_{k,p}^2.$$
This pure helper returns that marginal variance vector for one biomarker, for
a single MCMC draw.