Skip to content

Why don't the default residuals from sdmTMB match glm() or mgcv::gam()? #173

Answered by seananderson
seananderson asked this question in Q&A
Discussion options

You must be logged in to vote

Answer:

residuals.glm() is returning deviance residuals by default. residuals.sdmTMB() is returning randomized quantile residuals by default. Randomized-quantile residuals are transformed to be a standard normal distribution if the model is consistent with the data. We don't have deviance residuals in sdmTMB currently, although we probably should. The type = "response" should match between the two. An sdmTMB model with spatial = "off" (and spatiotemporal = "off") should match a call to glm() exactly. We have many internal tests to make sure that's the case.

I made the default randomized quantile because I thought they'd be most useful for my work, but that was before I planned on others u…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by seananderson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant