opetchey / multifarious_response_diversity

MIT License
0 stars 0 forks source link

Calculating partial derivatives #2

Open opetchey opened 1 year ago

opetchey commented 1 year ago

Seems that gratia::derivatives may not, currently, be able to do what we need. https://github.com/gavinsimpson/gratia/issues/101 https://stats.stackexchange.com/questions/495775/first-derivative-of-fitted-gam-changes-according-to-specified-model-distribution

Indeed, gratia::derivatives does not work when it is given a gam that includes a term that is something like an interaction term, e.g. gam(y ~ ti(x1) + ti(x2) + ti(x1, x2) (https://www.rdocumentation.org/packages/mgcv/versions/1.8-40/topics/te states that ti is good when setting up a gam with main effects and interaction structure.

I know next to nothing about the inner workings of gams, so would either have to put in a lot of time. Perhaps one of you knows enough / wants to learn enough. Or we get someone to help.

opetchey commented 1 year ago

I learned more about GAMS (mostly by watching Introduction to Generalized Additive Models with R and mgcv by Gavin Simpson). I'm a bit more confident about how to use them, including fitting an interaction term (or not). But we still have the problem above.

One option is to ask Gavin Simpson if he's interested in and able to work on this with us. What do you think? @pennekampster @SamRPJRoss @FrancescoPola

SamRPJRoss commented 1 year ago

FYI I saw Gavin's talk at ESA a few weeks ago and thought then how relevant his work is to what we're trying to do. Didn't get a chance to talk to him about it, though (it was the last day!). So yes, I would be supportive of us reaching out to him if we decide to invite someone external who's into GAMs.

FrancescoPola commented 1 year ago

I don't have anything against getting him on board. Especially if he can provide substantial help, I think it'd be a good collaboration opportunity.