Proposal for TuringRegressions.jl - Bayesian regression model alternative to TuringGLM.jl

Hi everyone,

I would like to propose TuringRegressions.jl - a more fully featured alternative to TuringGLM.jl offering much more of what brms does in R, most notably:

  • correlated random effect slopes, i.e. full support for formula terms such as (1|g), (1+x|g), (1+x|g&f)
  • internal standardisation of model fit, giving accurate and fast results vs brms benchmarks
  • easy extraction of parameter values
  • tidy model summaries
  • prediction including on new data
  • StatsAPI integration - all TuringRegressions are StatsAPI.RegressionModels (as far as possible)
  • exportable and adaptable Turing model code

I haven’t submitted it to the registry yet, since I wanted to gather some feedback first:

  • Would people find this package useful?
  • Is the API sensible? Would people like to see any changes?
  • Is the scope too broad?

It’s my first time doing this, and I might have bitten off more than I can chew - so all and any feedback would be very welcome! Even more welcome would be a review, though I realise that would be a lot to ask.

AI usage: I used Claude to help with the random-effects implementation around parameter reshaping and standardisation, as well as (especially) for writing the tests, benchmarks (entirely), and docstrings. I’ve reviewed the code, and the main verification comes with a suite of fits matched against brms outputs.

Welcome to the community, @jalster :waving_hand:

One thing that I would do is create a proper docs site (e.g., with Documenter.jl). I do like a thorough README.md that serves as a kind of cheat sheet, but having a nice docs page is also helpful.

I am not an expert in this domain, but I’ve always felt slightly uneasy about these kinds of packages that make specifying Bayesian hierarchical models quick and easy. When I first started learning Bayesian modeling, what I liked was the fact that it forced you to really think through all the priors and how to specify them properly, so relying on default priors hasn’t ever really sat well with me. I like that “[p]riors are somewhat customisable,” but I really prefer to have full control over the priors.

Please don’t take this as negative feedback, I really want to be constructive here - and again, welcome to the amazing Julia community!

I like your thought process with this. Question, wouldn’t it be better to implement a “brms” style into Turingglm?