Uniform prior much slower?

Is it me or is a dist.Uniform() prior much slower to sample from (MCMC NUTS in Numpyro) than other distributions? I thought it was because I used an init_strategy=init_to_median but init_to_sample is very slow as well.

Using smaller bounds seems to have made it a little quicker but it’s still significantly slower than other distributions (6 minutes vs 2 minutes for other distributions). Most of that seems to be caused during the warmup phase.

Quick background: I’m comparing a uniform prior to various informative priors to test the added benefit of adding domain knowledge to patient models.
I hope and expect that adding more expert knowledge will improve model sensibility (e.g., the directionality of certain parameters, e.g., the effect of physical activity on BMI) where the data is unsure, without resulting in significant reductions in predictive out-of-sample accuracy.

This depends on your model I guess. With uniform prior, probably your posterior geometry is trickier to sample from. :upside_down_face:

1 Like

Ah OK, make sense, thanks!