-
Notifications
You must be signed in to change notification settings - Fork 20
Add locfit option to type_loess function #509
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
base: main
Are you sure you want to change the base?
Conversation
this is just a suggestion loess is extremely slow or just impossible to use on even moderate sized data sets an alternative is locfit which can be added as an option here (or a separate type) to compare speeds and results see for example: library(data.table) n = 10000 dt = data.table(sex = rep(c(1.0,0.0), each = n)) dt[, x := rnorm(.N)] dt[, y := 1 + 0.5*sex + (1-0.2*sex)*x - (0.5 - 0.1*sex)*x^2 + 0.05*sex*x^3 + rnorm(.N)] dt$sex = as.factor(dt$sex) # n = 10000: user system elapsed # 49.860 17.245 87.297 # n = 20000: Error: vector memory limit of 16.0 Gb reached, see mem.maxVSize() plt(y ~ x, dt, type="loess") # n = 10000: 0.165 0.017 0.213 # n = 20000: 0.333 0.037 0.406 plt(y ~ x, dt, type=type_loess(locfit=TRUE))
|
Thanks for this! If we're going to merge this, we'd need to add to Suggests and also add a call to But we should probably have a larger discussion about the extent to which we want to include calls to external packages in the code base. Currently, there is only very minimal use, and this would be a qualitative shift. If we don't merge this, it may be a good candidate for a "user-designed types" library to be posted on the website. |
|
yes i realize that. i just wanted to put this out there because the practical limitations of loess makes it mostly useless to me (and to many others working with moderate to large datasets as well i suspect), while it is a plot type i use a lot... |
|
Thanks for the PR Edwin @eleuven and for raising the more general issue about dependencies Vincent @vincentarelbundock. I'm sure Grant @grantmcdermott will already have thought about how to deal with such dependencies - but just in case it is useful, I will post some thoughts.
So I think it would be justifiable to add this into P.S.: A lesser known fact is that even base R packages have "Suggests" dependencies to non-base packages. These are mostly to "recommended" packages, e.g., |
|
Interesting! Didn't know several of those facts. |
|
Oh, and a quick aside on the slowness of I seem to recall a recent thread on BlueSky where some users were bemoaning the silent (?) switching from |
|
Thanks for the pointer. Indeed |
this is just a suggestion
loess is extremely slow or just impossible to use on even moderate sized data sets
an alternative is locfit which can be added as an option here (or a separate type)
to compare speeds and results see for example: