I’m trying to figure out how to calculate the Bayes Factor for a directional hypothesis test of the form P(\beta > 0 | X) relative to P(\beta < 0 | X). But I can’t figure out the best way to do this in the Stan framework.

Is it as simple as using the posterior for \beta and calculating the ratio between the positive and negative values for \beta? Or does this involve fitting two constrained models, one where \beta is forced to be positive and the other negative, and then using something like bridge sampling to get the likelihoods and Bayes factors of the two models?

Or are neither of these the correct approach?