New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
penalized GAMs? #704
Comments
As shown in the link you include, both the design matrix X and the penalty matrix S can easily be obtained from mgcv. I have used this approach in the past with plain TMB, and fitting the model matches the mgcv output closely. I think the mgcv package will provide a lot of infrastructure. |
I agree that the basic idea is simple; designing things so that the integration into glmmTMB is simple and transparent is the harder part (we could start by adding this example to a vignette, with permission ... then making a helper function to automate some parts of it ...) |
Sounds like a good idea. We could even write a small wrapper function that calculates Xf and Xr (and hide details that the user does not need to understand). The most difficult thing for the user will be the map argument, especially I assume the order of RE-terms in the linear predictor determines the order of terms in theta. A list The vignette should also contain a line of R code showing how to turn theta I hope/believe that AIC values calculated by glmmTMB will agree with stuff returned by mgcv, |
new improved example from Devin Johnson: https://gist.github.com/dsjohnson/9d66aa47557ad56438aaf75dd25910ea |
That definitely makes the code easier. But how to handle multiple splines (different covariates), and splines in combination with other fixed and random effects? The real challenge is how set up the map argument in these more complicated situations. One can either |
... or, if a new structured covariance matrix type could be introduced in glmmTMB: diaghomosced (diagonal, homogeneous variance) it would remove the need to use "map" entirely. It would also have the benefit of giving |
a diagonal/homogeneous variance type is a good idea in any case, and should be super-easy to code. For example, |
Yes, a short name i better. I had in mind 'dhom' for "diagonal homogeneous". |
Is the diagonal homogeneous variance option already available? I would like to try it in combination with splines for multiple covariates for beta-binomial distributed data. |
No, it has not been implemented yet (as far as I know). |
pity, it would be very useful. But thanks for the answer |
I implemented the homogeneous diagonal stuff. The next issue is that, if we use the |
Maybe we can add syntax to allow mgcv-type smooths (as brms does, or like gamm4 - but hopefully less clunky than gamm4! https://gist.github.com/dsjohnson/9d66aa47557ad56438aaf75dd25910ea)
The text was updated successfully, but these errors were encountered: