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

Convergence checks for additive submodels #479

Open
fweber144 opened this issue Nov 22, 2023 · 4 comments
Open

Convergence checks for additive submodels #479

fweber144 opened this issue Nov 22, 2023 · 4 comments
Labels
additive Issues concerning additive models (GAMs and GAMMs).

Comments

@fweber144
Copy link
Collaborator

As mentioned in #478, the convergence checks for additive models are probably still incomplete, even with PR #478 being merged now. I have added corresponding TODO comments in the code, lines

# TODO (GAMs): Is this correct?:
return(fit_s$converged && fit_s$mgcv.conv$fully.converged %||% TRUE)
and
# TODO (GAMMs): I couldn't find any convergence-related information in
# element `fit_s$gam`, so the GAM part is currently not checked for
# convergence. For now, all we can check is the GLMM part from element
# `fit_s$mer`:

@AlejandroCatalina, do you know if (and if yes, how) we could improve our check for convergence of the submodel fits from fit_gam_callback() and fit_gamm_callback()?

@fweber144 fweber144 added the additive Issues concerning additive models (GAMs and GAMMs). label Nov 22, 2023
@AlejandroCatalina
Copy link
Collaborator

Aside from the diagnostics fit_s$gam would provide I'm not sure how much we could inject it. I would suspect we can indeed run some diagnostics on top. For GAM I'd think that similar diagnostics to GLM should work, as it's fitting an augmented GLM underneath, and for GAMM one would need to check the quality of the laplace approximation, but this may not be very obvious from outside.

@fweber144
Copy link
Collaborator Author

Actually, I was looking for some output element of the submodel fits returned by fit_gam_callback() and fit_gamm_callback() that indicates convergence. So for GAMs, I would need approval that

# TODO (GAMs): Is this correct?:
return(fit_s$converged && fit_s$mgcv.conv$fully.converged %||% TRUE)
is correct and for GAMMs, I wonder where the same elements from gamm_fit_s$gam are (where gamm_fit_s indicates an object returned by fit_gamm_callback()). Implementing own diagnostics is not a bad idea, but usually, there is always a convergence indicator somewhere in the output object (so we wouldn't have to implement new diagnostics ourselves).

@AlejandroCatalinaF
Copy link

I believe that line is okay, but I haven't worked with that package for some time, so I'm afraid I can give you much insight regarding their internals.

@fweber144
Copy link
Collaborator Author

No problem, I understand. Then I guess someone needs to inspect this in detail in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
additive Issues concerning additive models (GAMs and GAMMs).
Projects
None yet
Development

No branches or pull requests

3 participants