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

Switch to qgam for quantile regressions #53

Closed
florianhartig opened this issue Apr 3, 2018 · 6 comments
Closed

Switch to qgam for quantile regressions #53

florianhartig opened this issue Apr 3, 2018 · 6 comments
Milestone

Comments

@florianhartig
Copy link
Owner

florianhartig commented Apr 3, 2018

Idea: switch to https://cran.r-project.org/web/packages/qgam/index.html for calculating quantile regressions in plotResiduals

@florianhartig
Copy link
Owner Author

florianhartig commented Dec 17, 2019

An issue is that qgam sometimes throws errors for small data sizes. Example code

testData = createData(sampleSize = 50, family = gaussian())
fittedModel <- lm(observedResponse ~ Environment1, data = testData)

res = simulateResiduals(fittedModel)
plot(res) # current quantile plot

library(qgam)
dat=data.frame(res =  res$scaledResiduals , pred = predict(fittedModel))
fit <- qgam(res ~ s(pred),  data =dat, qu = 0.5)
# tends to throw wrror for small n

@mfasiolo
Copy link

Hi Florian,

The new version of qgam on https://github.com/mfasiolo/qgam should avoid this.
Let me know if you encounter further problems.

Matteo

@florianhartig
Copy link
Owner Author

Yes, this works - any idea when this will go to CRAN?

@florianhartig
Copy link
Owner Author

Matteo, I'm just playing around with that - your package is awesome, especially that one gets CIs and p-values on the splines, this will be a great addition to DHARMa because I can directly read of p-values for the residual tests!

@florianhartig
Copy link
Owner Author

florianhartig commented Jan 7, 2020

A version of DHARMa based on qgam is now available in the branch qgam-switch. These are the old plots

image

These are the new plots

image

There is also a new testQuantiles function. This can be tried via installing

devtools::install_github("florianhartig/DHARMa/DHARMa", ref = "qgam-switch")

@florianhartig florianhartig changed the title test qgam Switch to qgam for quantile regressions Jan 16, 2020
@florianhartig florianhartig added this to the 0.3.0 milestone Feb 19, 2020
@florianhartig
Copy link
Owner Author

This is basically implemented in 0.3 dev so I will close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants