Other packages (e.g., brms, rstanarm, and bbsBayes2) that depend on Stan have added a dependency on mgcv to create the “design matrices” associated to a GAM from a formula. Then, the linear coefficients associated to non-linear term (it sounds contradictory, but that’s right) are penalized through an hierarchical prior.
Digging into their code will give us some ideas on how to implement it.
Other packages (e.g., brms, rstanarm, and bbsBayes2) that depend on
Stanhave added a dependency onmgcvto create the “design matrices” associated to a GAM from a formula. Then, the linear coefficients associated to non-linear term (it sounds contradictory, but that’s right) are penalized through an hierarchical prior.Digging into their code will give us some ideas on how to implement it.