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

Change the default estimation method for gam in geom_smooth() #2630

Closed
clauswilke opened this issue May 18, 2018 · 3 comments
Closed

Change the default estimation method for gam in geom_smooth() #2630

clauswilke opened this issue May 18, 2018 · 3 comments
Labels
feature a feature request or enhancement layers 📈 tidy-dev-day 🤓 Tidyverse Developer Day

Comments

@clauswilke
Copy link
Member

As recommended by the maintainer of the mgcv package, Simon Wood, it might be better to set method = "REML" in the gam() call for geom_smooth(). I quote:

REML smoothing parameter estimation is less prone to occasional under-smoothing than GCV (e.g. gam(..., method="REML"))

@clauswilke clauswilke added the feature a feature request or enhancement label May 18, 2018
@clauswilke
Copy link
Member Author

One more comment from Simon Wood:

Theoretically REML will undersmooth relative to GCV in the large sample limit and have slightly worse MSE performance, but for me the finite sample performance trumps this: Reiss and Ogden, 2009, JRSSB give some theory for why.

The Reiss and Ogden paper is available here: http://www.jstor.org/stable/40247585

gam(..., method = "REML") will work for mgcv versions >=1.5-0, March 2009.

@hadley hadley added layers 📈 tidy-dev-day 🤓 Tidyverse Developer Day labels Jun 18, 2019
@hadley
Copy link
Member

hadley commented Jun 18, 2019

This should be a straightforward tweak to the existing code, and just needs a news bullet. It is likely to create small changes in some existing plots, but I don't think the differences should be too serious (although it might cause visual tests to fail)

@lock
Copy link

lock bot commented Jan 5, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement layers 📈 tidy-dev-day 🤓 Tidyverse Developer Day
Projects
None yet
Development

No branches or pull requests

2 participants