-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add support for mgcv #130
Comments
I think implementing those pieces in |
Yeah, that makes sense. That is about the right level of abstraction based on how |
I have realised that |
You're in good company, brms and rstanarm also return matrices! I'm happy for tidybayes to handle the matrix -> long data frame part if gratia generates the matrix form for both the posterior and the posterior predictive. |
Since gratia has a lot of standalone utility I'd be in favor of data frame
conversion in gratia itself, if that's doable.
…On Tue, Sep 4, 2018, 7:06 PM Matthew Kay ***@***.***> wrote:
You're in good company, brms and rstanarm also return matrices! I'm happy
for tidybayes to handle the matrix -> long data frame part if gratia
generates the matrix form for both the posterior and the posterior
predictive.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#130 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOYTa85m4FKzxeWmDWJtJBfFIjB-xfV0ks5uXxVygaJpZM4WZusk>
.
|
I would not object! Makes my life easier. :) @gavinsimpson, if you are interested in having the output be compatible with Mean time I'll wait on gratia for this and then wrap whatever you decide to do in |
Hi @mjskay @alexpghayes - following up on this. I've been working on this from the mgcv/gratia side. I now have
(I'll add a The examples here show this in action: https://gavinsimpson.github.io/gratia/reference/predicted_samples.html I opened an issue on gratia gavinsimpson/gratia#52 to note that I need to convert to tidybayes objects as I followed a different naming convention. As that issue notes, I thought of adding So, just to confirm; seems like @alexpghayes was favouring having the conversion code in gratia, but not sure if that was just going to a data frame or if he preferred gratia to have code needed to return tidybayes compliant tibbles directly. The Another issue is the |
I would just keep it all in |
Thanks for coming back around to this @gavinsimpson! Some thoughts:
|
Is the concern here that |
Thanks @alexpghayes @mjskay. Some follow-up thoughts/comments/responses. I was trying to avoid having gratia have any dependency on tidybayes. I have no issue with tidybayes, but I didn't want to become reliant on another package largely because I'm finding it difficult enough at the moment juggling life and work. So I was trying to have a way that tidybayes could hook into gratia for the GAM/mgcv functionality. I assumed you would make the I guess I envisaged Thinking about this having read your comments, it would appear that I favour having
Would that work for everyone? If so I can do a first pass on the |
@gavinsimpson that sounds like a good approach to me! @alexpghayes Right, the concern I had was that either the output format or the arguments will be inconsistent across implementations (mostly the arguments; I think the output format is straightforward). I imagine that it is easier to ensure consistency when the various functions all live in the same package, as in broom, and was trying to adopt a similar model for tidybayes. I suspect that trying to keep those interfaces consistent when the implementations are spread across many packages is very difficult; the inconsistencies in base-R generic function interfaces across packages is one example of this. I see the multiple-packages-necessary-for-users argument as a little less concerning when I try to imagine use cases for
This is why I think @gavinsimpson's proposal is a good path forward. |
The size of the set of packages that tidybayes might want to operate on is much smaller than those that broom might want to operate on, but I do think it is worth considering at this stage whether you really want functionality for potentially all of these packages (and the inherent issues that a huge number of potential Imports/dependencies brings) to live in tidybayes? With broom we're seeing (perhaps, at least this is my view) the impact of this (it's a huge package with many moving parts now and is probably a nightmare to maintain and have package authors contribute as they need to install a huge amount of add-ons to work on their little bit) and the move to having separate broom-related packages (like the mixed models one). Is this something you are concerned about, want to think about now? In which case I could prepare a |
Ah good point, I hadn't thought about that potential maintenance issue (maybe I wasn't thinking ambitiously enough? :) ) Maybe a Is the convention |
Re naming conventions; I'm not sure, but in the broom context it is broom.mixed so let's follow them. OK; I'll set up a repo on GH for tidybayes.gam and get some functionality working and then get back to you for input/comment. |
Great, thanks! |
I think this is all covered within {gratia} now, no? Closing this unless something comes up. |
Looks like
gratia::simulate
might be a direction for supporting mgcv intidybayes::fitted_draws
. Still todo: find the pieces to supporttidy_draws
andpredicted_draws
as well.cc @gavinsimpson @noamross @alexpghayes
The text was updated successfully, but these errors were encountered: