Previously we showed that even though univariate analysis with degenerated MASH model gives identical results to SuSiE as expected (with non-decreasing ELBO), in multivariate calculations the ELBO is not always non-decreasing. To investigate the issue we will 1) further simplify the problem and 2) isolate the problem to posterior calculation versus ELBO calculations and check which part is problematic. The best way to achieve both is to implement a simple Bayesian multivariate regression model with prior $b \sim MVN(0, U)$ where $U$ is known, instead of using MASH prior for $b$.
This feature is now implemented in the BayesianMultivariateRegression
class with an interface added to the main function such that the code will be triggered when prior variance is a matrix.
With this feature (and with Yuxin's sharp eyes!!) we were able to identify an issue caused by inconsistent interface between mvsusieR::susie
and mvsusieR::MashInitializer
in handling residual variances. After patching the issue (interface fix still needs to be finalized) we are able to get consistent result between simple Bayesian multivariate regression and MASH; and MASH ELBO now increases.
library(mvsusieR)
set.seed(2)
L = 5
dat = mvsusie_sim1(r=1)
Run the simulated univariate data with SuSiE,
res = susieR::susie(dat$X,dat$y,L=L,scaled_prior_variance=0.2,estimate_residual_variance=F,estimate_prior_variance=F)
res$elbo
Now run it with multivariate simple prior implementation in mvsusieR
,
res = mvsusieR::mvsusie(dat$X,dat$y,L=L,prior_variance=0.2*var(dat$y),compute_objective=T,estimate_residual_variance=F,estimate_prior_variance=F)
dim(res$b2)
So it is confirmed that this implementation produces identical results as SuSiE runs.
set.seed(2)
dat = mvsusie_sim1(r=1)
devtools::load_all('~/GIT/software/mvsusieR')
res = mvsusie(dat$X,dat$y,L=L,prior_variance=dat$V,compute_objective=T,estimate_residual_variance=F,estimate_prior_variance=F)
Here the ELBO is non-decreasing, as expected.
m_init = mvsusieR:::MashInitializer$new(list(dat$V), 1, prior_weight=1, null_weight=0)
res = mvsusieR::mvsusie(dat$X,dat$y,L=L,prior_variance=m_init,compute_objective=T,estimate_residual_variance=F,estimate_prior_variance=F)
dim(res$b2)
The result agree with above. Now we use a different prior choice -- a diagonal prior covariance. We analyze with simple Bayesian multivariate regression,
res = mvsusieR::mvsusie(dat$X,dat$y,L=L,prior_variance=0.2*diag(ncol(dat$y)),compute_objective=T,estimate_residual_variance=F,estimate_prior_variance=F)
res$elbo
and with MASH based regression,
m_init = mvsusieR:::MashInitializer$new(list(0.2*diag(ncol(dat$y))), 1, prior_weight=1, null_weight=0,alpha=0)
res = mvsusieR::mvsusie(dat$X,dat$y,L=L,prior_variance=m_init,compute_objective=T,estimate_residual_variance=F,estimate_prior_variance=F)
res$elbo
So we are comfortable at this point that ELBO for multivariate analysis is done correctly.