GeneralizedGammaLSS#

class superglm.GeneralizedGammaLSS(
parametrisation: Literal['mean', 'location'] = 'mean',
scale_floor: float = 0.01,
)#

Bases: MeanPredictor, LocationPredictor, ScalePredictor, ShapePredictor

Generalized gamma with natural parameters (mean | location, scale, shape).

Prentice’s (mu, sigma, Q) law on y > 0: shape = 0 is the log-normal, shape = 1 the Weibull, shape = scale the gamma. The default mean form puts E[Y] first under a log link, so its relativities multiply the mean; the location form puts the log-scale location first under an identity link and admits an infinite mean.

Parameters:
parametrisation{“mean”, “location”}, default=”mean”

Choose family.mean(...) for the conditional response mean or family.location(...) for Prentice’s log-scale location. Declare family.scale(...) and family.shape(...) in either form. Scale is Prentice’s sigma and shape is Q. Scale need not equal the standard deviation of the response or its logarithm.

scale_floorfloat, default=0.01

Nonnegative lower bound on scale. Its default link is log(scale - scale_floor). Shape uses an identity link.

Notes

Changing the first parameter changes what its additive predictor describes. The mean form requires a finite response mean. Results contain mean, scale, shape or location, scale, shape. predict returns the response mean in both forms, including infinity where the mean does not exist in the location form.

variance(
theta: NDArray,
) → NDArray[float64]#

Population variance, with infinity for a divergent second moment.

expected_shortfall(
p: NDArray,
theta: NDArray,
) → NDArray[float64]#

E[Y | Y > q_p] per row in either natural parametrisation.