Calculating the Bayes factor for a directional hypothesis?

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?

Yes, you can actually just calculate the ratio, provided that the prior on \beta is symmetric.

See also here:
Marsman, M., & Wagenmakers, E.-J. (2017). Three Insights from a Bayesian Interpretation of the One-Sided P Value. Educational and Psychological Measurement, 77(3), 529–539.

1 Like

Thanks so much!

If this answers your question, you can mark it as solutions :-).

1 Like