.Call error when using bayes_factor

Hi all,

I have run a bayesian linear mixed model using brm(), but when I try to use bayes_factor, I get a .Call error message. Specifically,

I created a brm fit object using default prior:
fit1<-brm(y~x+(1|gp1)+(1|g2)), data=data, save_all_pars=TRUE)
fit0<-brm(y~(1|gp1)+(1|gp2),data=data, save_all_pars=TRUE)

These all run well. But when I used:

I got two error messages:
Error in .Call(“dmvtCpp”, X_ = X, mu_ = mu, sigma_ = sigma, df = -1, log_ = log, :
“dmvtCpp” not resolved from current namespace (mvnfast)
Error: Bridgesampling failed. Did you set ‘save_all_pars’ to TRUE when fitting your model?

For the second one, I did set save_all_pars=TRUE so I guess it’s just an error that’s tied to the first one?

I tried googling the problem on .call error, but can’t find any good solutions. Any help is much appreciated!

I’ve been bitten by a variant of the very same problem. It might be brms-specific, but I don’t know how to toggle the relevant tag.

Following suggestions by Paul-Christian Buekner, the problem seems to be fixed by brute-force reinstallation of rstan, 'mvnfastandloo`.

Don’t ask me why and/or how: that’s pure voodoo for me. I might as well have sacrificed a goat…

1 Like

I’ve been dealing with the same error. Any updates on solving the problem?

Is the only solution to re-install RSTAN or would specific packages suffice?


mvnfast has been deactived for the time being in the dev version of bridgesampling (see quentingronau/bridgesampling#20).