Why residual bootstrap does not work for GLM? My lecture note says

Since we add residuals to the fitted model, this residual bootstrap only works for a homoscedastic regression model, where the error distribution does not depend on the predictors. This means it cannot be used for GLM.

My question is what is "error distribution" in the GLM? And why "error distribution depends on the predictors" so that "residual bootstrap does not work for GLM"?
 A: It won't work with raw residuals for several reasons, but arguably can work - at least for some cases - with other choices. E.g pearson residuals can take care of the heteroskedasticity issue.
Other choices can reflect other aspects as well E.g. gamma regression often seems to work fairly well with anscombe residuals or deviance residuals. For discrete data you may need to either round to integers or go to a quasi-glm.
There's also the possibility of simple row-resampling, though I would only consider it with a lot of data.
Then there's parametric bootstrapping.
Check our to book by Davison and Hinkley for examples of bootstrapping glms
There isn't really an error distribution in a glm in the sense of the thing a residual approximates - only the Gaussian has additive constant variance error, arguably the gamma has a multiplicative error, but most glms the residuals change shape as well as variance as the mean changes. I'd strongly advise not trying to conceive of glms in terms of error iin general, but instead in terms of conditional distributions.
