Skip to content
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

Adding GAMData struct #37

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yahrMason
Copy link

Working on refactoring the model functions to use struct arguments.

I reviewed the text and got a much better understanding of how to build the penalty matrix for handling multiple smoothing terms. I now have a working example off of the trees data set that converges to a solution for the smoothing penalties.

I will look to extend this to handle generalized additive models with different link functions.

@yahrMason yahrMason marked this pull request as draft May 7, 2024 03:23
@yahrMason
Copy link
Author

Still need to clean up the functions a bit by adding doc strings and perhaps better typing. Also need to add "smooth" indicators to the struct so that it can handle both smooth and non-smooth terms.

@hendersontrent
Copy link
Owner

hendersontrent commented May 7, 2024

Thanks for this! Just tested it all -- looking real nice! Turns out that having a copy of the textbook at hand is useful! Super keen to see where you get this to :) I'm happy to help with docstrings and things too!

@hendersontrent hendersontrent added documentation Improvements or additions to documentation enhancement New feature or request labels May 8, 2024
@yahrMason
Copy link
Author

Thanks! Your previous comments about GCV not being appropriate for models where the dependent variable follows a non-normal distribution were correct. He outlines two additional approaches in his text that handle the generalized cases. One is the random effects approach, which I think MixedModels.jl could be a good candidate for. The other is the Penalized Iteratively Re-weighted Least Squares (PIRLS) algorithm. That looks pretty straight forward so will try my hand at implementing that.

@hendersontrent
Copy link
Owner

Yep, I am aware of the random effects/spline stuff (see https://www.tjmahr.com/random-effects-penalized-splines-same-thing/ for a great overview). If you feel confident trying PIRLS then I think we start there. May as well get something working with one less dependency for now!

@hendersontrent
Copy link
Owner

Sorry, I would contribute more but I am a bit slammed across PhD and work at the moment. Hopefully can help out more substantively soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants