rstanarm icon indicating copy to clipboard operation
rstanarm copied to clipboard

Request: flexible residual covariance structures

Open wlandau opened this issue 3 years ago • 4 comments

Summary:

It would be great if rstanarm supported more advanced structures for the covariance matrix of the residuals.

Description:

I use Bayesian longitudinal models for clinical trial data analysis, usually MMRM and GLIMMIX. The norm in the open source world seems to be to express longitudinality through subject-specific random effects, and rstanarm is already capable of this. But for better or worse, all my stats colleagues are opposed to this approach. They believe this is not a true longitudinal model and that random effects would incur overparameterization issues anyway. This stance seems to be widespread in pharma. So I am required to avoid random effects and make the residual covariance block-diagonal, where the (common) block is fully parameterized (i.e. unstructured). Would you be open to allowing these covariances in stan_glm() and stan_glmer()? Currently, rstanarm is limited to $\sigma^2 I$, so I have to use MCMCglmm, which does not have as convenient an interface.

Reproducible Steps:

N/A

RStanARM Version:

2.12.1

R Version:

4.0.2

Operating System:

Mac OS 10

wlandau avatar Jun 07 '21 03:06 wlandau

Hi,

Can't speak for the rstanarm team as to whether they want to allow these particular covariances, but have you seen brms? I use it a lot for models that require a bit more flexibility than what rstanarm does (love rstanarm for teaching and simpler models though!). In brms the models need to be compiled, which can be a hassle, but it now supports cmdstanr as a back end, so it's much easier than it has been previously! :)

lauken13 avatar Jun 07 '21 03:06 lauken13

Thanks, @lauken13. I did look at brms, but https://www.jstatsoft.org/article/view/v080i01 seems to describe the same limitation. But I did find threads https://github.com/paul-buerkner/brms/issues/403 and https://discourse.mc-stan.org/t/unstructured-error-covariance-matrix-in-a-multilevel-growth-model/21792.

wlandau avatar Jun 07 '21 04:06 wlandau

I think my previous comment was too quick to dismiss brms, sorry about that. The capability was not officially documented last time I checked, but it looks like https://discourse.mc-stan.org/t/unstructured-error-covariance-matrix-in-a-multilevel-growth-model/21792/4 made progress on a workaround. I think it may work in my case because I do not need group-level effects.

wlandau avatar Jun 07 '21 04:06 wlandau

Yeah every time I look, Paul has implemented something else super nifty. Glad it helps! You can also modify the code from brms pretty easily if you only want a small component changed etc.

On Mon, Jun 7, 2021 at 2:41 PM Will Landau @.***> wrote:

I think my previous comment was too quick to dismiss brms, sorry about that. The capability wasn't there last time I checked, but it looks like https://discourse.mc-stan.org/t/unstructured-error-covariance-matrix-in-a-multilevel-growth-model/21792/4 has a bunch of progress on a workaround. I think it may work in my case because I do not need group-level effects.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstanarm/issues/532#issuecomment-855570688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5ZMGBHWUDZ4DEVOZGOVS3TRREYNANCNFSM46GYBJCQ .

lauken13 avatar Jun 07 '21 21:06 lauken13