spint.dispersion.alpha_disp

spint.dispersion.alpha_disp(model, alt_var=<function <lambda> at 0x7f264eaca8c8>)[source]

Test the hypothesis that var[y] = mu (equidispersion) against the alternative hypothesis that var[y] = mu + alpha * alt_var(mu) where mu is the expected value of y, alpha is an estimated coefficient, and alt_var() specifies an alternative variance as a function of mu. alt_var=lambda x:x corresponds to an alternative hypothesis of a negative binomimal model with a linear variance function and alt_var=lambda x:x**2 correspinds to an alternative hypothesis of a negative binomial model with a quadratic varaince function.

alpha > 0: overdispersion alpha = 1: equidispersion alpha < 0: underdispersion

Parameters
modelModel results class

function can only be called on a sucessfully fitted model which has a valid response variable, y, and a valid predicted response variable, yhat.

alt_varfunction

specifies an alternative varaince as a function of mu. Function must take a single scalar as input and return a single scalar as output

Returns
——-
array[alpha coefficient, tvalue of alpha, pvalue of alpha]