-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Multidimensional Spline Implementation #806
Comments
I could google it to find an implementation. But are you aware of numpy implementations of those, or something in R? (idk if mgcv writes them in R or in a lower-level language). If that is the case, we can easily add it to Bambi. |
Yeah, I did some searching last night hoping I could start it myself, but wound up punting after seeing the code.
As far as python, I don't know of any numpy implementation, and statsmodels current GAM implementation only supports 1D bsplines. PyGAM has a class called TensorTerm that's called directly when you use te. |
Thanks @tjburch! I'll have a look at those |
Just wanted to chime in that I've looked into the Basically you build individual splines for each dimension, then take the tensor (i.e. kronecker) product to generate your full design matrix. A quick look through the Getting |
Thanks for the insights @ptonner! |
A couple more thoughts here: I started looking into how you might implement this in bamb/formulae, but I'm not sure how you would handle a formula term that has multiple column names. E.g. is it possible to support something like Second, it looks like |
@ptonner thanks for the thoughts (and sorry for the late response). Yes, Bambi supports functions with more than a single variable. We already have We can basically create an arbitrary function. |
This might be opening a can of worms, but the 1D bspline implementation has been really nice to use - It would be really nice to have multidimensional splines, like tensor interaction (
ti
) or tensor smooth (te
) splines seen inmgcv
. Very often I'm looking for non-linearities within multiple dimensions and use those, a similar bambi implementation would be nice.The text was updated successfully, but these errors were encountered: