R Session crash while using vb function fullrank

I’m exploring variational inference in stan. I tried fitting a model using vb function. It runss with the default “meanfield” algorithm, but the results aren’t ideal. I then tried to use “fullrank”, but everytime I do that, my R session will crash and force restart.

Here I enclose my stan code as well as r code to run the data.

Also information of my systems:

mac os 10.15.5
R 4.0.2
rstan 2.21.1

Thanks!!

owa_ext_cont_mfvb.stan (877 Bytes) Question.R (1.7 KB)

I think @bgoodri released an RStan patch on CRAN (v2.21.2) that might fix this (I don’t know but could be worth a try), but one way to run VB without crashing R is to use the new the new CmdStanR interface (as I just suggested over in this thread: R Session Aborted). With CmdStanR you might still get errors if the VB algorithm encounters errors but it shouldn’t crash your R session.

Thanks a lot for getting back to me on this! I’ll try CmdStanR and see how it goes!

1 Like

Great, definitely let us know if you run into any trouble with CmdStanR. And if you’re willing, let us know if you don’t run into trouble (we like to know that it’s working properly!).