Open gragusa opened 1 year ago
Good catch. Actually this definition seems to have been there forever, though the implementation has been changed recently by https://github.com/JuliaStats/GLM.jl/pull/265. We should probably add a docstring to explain more precisely what this method returns as it's not necessarily obvious for users how the dispersion parameter must be handled (R doesn't say anything).
Cc: @andreasnoack @Nosferican
I noticed something odd about
dof_residual
. In few words, when thefamily
does not have adispersion_parameter
,dof_residual
is bumped by 1which is inconsistent with other software (R, Stata, etc.) and with statistics more generally :smile:.which gives
The families without a
dispersion_parameter
areBernoulli, Binomial, Poisson
:Fortunately,
dof_residuals
is not used to scale thevcov
and so this bug does not have important ramifications. I also noted that we are not testingdof_residual
for these families.The fix is relatively simple: change
to