Comments (2)
Seems this was closed and then extended in #365, which asks specifically about uniformity in res ~ pred plots. In any case, as I received a very similar question via email, I will hijack this issue and re-open - these are the questions via Email:
Is there any difference between the DHARMa RQR and Dunn and Smyth´s RQR?
Regarding Dunn and Smyth residuals, it seems that for a well-fitted model, the residual vs. predicted/adjusted values plot will present a random distribution of the residuals, centered on zero, with constant variance (since they follow a Normal distribution). With DHARMa residuals, since they vary between 0 and 1, the residual plot should be centered around a y-value of 0.5, right? Also, here the term "random distribution" should be replaced by "uniform distribution", right?
The DHARMa residuals are standardized between 0 and 1. This is resulting from the range values of the cumulative density function, or is there some step that I´m missing along the procedures of generating the residuals? Perhaps this is a difference regarding Dunn and Smyth residuals?
The QQ plot Residuals is built against an expected distribution. The uniform distribution, is that correct? Could you explain to me how the residuals should approximate this distribution and not the Normal distribution? I mean, I think I´m missing all the steps and logic/rational that is behind the uniform distribution, probably being a lack of statistical insight...
from dharma.
Is there any difference between the DHARMa RQR and Dunn and Smyth´s RQR?
The idea is the same. In detail, DHARMa has several options to calculate the randomisation, notably you can change refit = T/F and the quantile calculation (which includes the randomisation) via the method argument.
I tend to think that the current default procedure with refit = F and method = PIT is identical to what Dunn and Smyth propose in their paper, but should probably re-check this in detail.
Regarding Dunn and Smyth residuals, it seems that for a well-fitted model, the residual vs. predicted/adjusted values plot will present a random distribution of the residuals, centered on zero, with constant variance (since they follow a Normal distribution). With DHARMa residuals, since they vary between 0 and 1, the residual plot should be centered around a y-value of 0.5, right? Also, here the term "random distribution" should be replaced by "uniform distribution", right?
Random is for me just the umbrella term, and then there is random uniform and random normal.
About the distribution: once you have the ecdf, you can transform to any distribution. If you want to have normal instead of uniform, see examples in https://rdrr.io/cran/DHARMa/man/residuals.DHARMa.html
I have decided to choose uniformity for the plots / tests for reasons discussed here #39
The DHARMa residuals are standardized between 0 and 1. This is resulting from the range values of the cumulative density function, or is there some step that I´m missing along the procedures of generating the residuals? Perhaps this is a difference regarding Dunn and Smyth residuals?
No, this is just the property of the ecdf. Dunn and Smyth residuals are the same, they just transform the uniform to normal thereafter.
The QQ plot Residuals is built against an expected distribution. The uniform distribution, is that correct? Could you explain to me how the residuals should approximate this distribution and not the Normal distribution? I mean, I think I´m missing all the steps and logic/rational that is behind the uniform distribution, probably being a lack of statistical insight...
OK, this all goes back to the same misunderstanding. A quantile is something on the range of 0 - 1, thus quantile residuals are inherently uniform, also Dunn and Smyth residuals. Once the quantile is calculated, you can transform to other distributions.
Dunn and Smyth have decided to transform to normal afterwards, because they assumed people are more used to a normal distribution. If you transform to normal, a deviation from model assumptions will show up as a deviation from normality, thus you should test if the residuals are normal.
In DHARMa, I keep the residuals in their original uniform distributions (again, see reasons here #39). Thus, for DHARMa residuals, a deviation from H0 shows as a deviation from uniformity.
Again, if you prefer normal residuals, use https://rdrr.io/cran/DHARMa/man/residuals.DHARMa.html - note though that you have to write your own tests / plots then, or use plots designed for other normal residuals.
from dharma.
Related Issues (20)
- Dealing with non-uniform residuals in y-direction when plotted against predictor(s) HOT 2
- testDispersion() default fails to detect overdispersion in a Poisson GLMM HOT 4
- Question about using DHARMa for Bernoulli Response Data
- Add support for nls
- Diagnostic plots for model using glmmTMB and Beta distibution HOT 6
- could not find function "ensureDHARMa"
- plotResiduals() falls back to predict and doesn't create a warning if variable doesn't exist
- Implement option to use DHARMa plots on general residual definition (bypassing simulation)
- Power of the KS test HOT 1
- How to resolve the residual versus predicted quantile devation (Dharma plot)?
- Could not find documentation on red-shaded area around smooth spline HOT 2
- Pattern in RE-grouped residual for binomial GLMM HOT 2
- Adjust DHARMa plots for color blindness
- DHARMa: fittedModel not in class of supported models for a glmmTMB model HOT 3
- Dispersion calculations for mdcv tweedie distribution HOT 1
- Clarify dispersion tests
- Extracted Pearson residuals wrong for mccv (type should be "scaled.pearson")
- Adding support for multinomial family in mcvc::gam HOT 4
- Simulations with infitite values for weighted binomial GAM, interpreting plots HOT 3
- Move all function links to me md syntax [simulateResiduals]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dharma.