hendersontrent / GAM.jl

Fit, evaluate, and visualise generalised additive models (GAMs) in native Julia
MIT License
24 stars 3 forks source link

Specify GAM model in Turing? #18

Open DominiqueMakowski opened 1 year ago

DominiqueMakowski commented 1 year ago

I am aware this issue might be out of scope with respect to this package, but I couldn't think of a better place to ask ☺️

Would you know by any chance if it's feasible to specify a GAM in Turing, and if so how would such a mode look like, assuming the simple case y ~ s(x) where y and x are two continuous variables.

hendersontrent commented 1 year ago

The final example in this great post is a fantastic reference point, although I hope to add that functionality here too, eventually! It's not the beautiful mgcv syntax, but my intention is to take this package down that route.

DominiqueMakowski commented 10 months ago

Cool, thanks!

Some additional thoughts are that as you know, packages like brms offload a lot of the model-specific heavy-lifting to specialized packages, for instance, it uses the spline constructor capabilities from mgcv whenever s() is in the formula.

It seems like in Julia, TuringGLM is also somewhat taking that route, for instance by taking formula interface features from MixedModels.jl (for the specification of random effects). So I could in principle envision that such package would also take capabilities from GAM.jl (formula interface + constructors) to enable easy GAMs in Turing. Is it what you had in mind for possible future developments?