GammaLS#
- class superglm.GammaLS#
Bases:
MeanPredictor,ScalePredictorPositive responses with mean and coefficient-of-variation predictors.
Declare
family.mean(...)andfamily.scale(...). Both use log links. Herescaleis the coefficient of variation, so the unit-law variance ismean**2 * scale**2. It is the square root of GLM Gamma dispersion, and differs from the scale argument ofscipy.stats.gamma.Results use the column names
meanandscalein that order. Responses must be strictly positive. An empty helper call estimates a constant parameter through an intercept-only predictor.See also
SuperLSSConstruct and fit a model with these predictors.
- predictor_curvature_directional_derivative(
- y: NDArray,
- eta: NDArray,
- eta_direction: NDArray,
- links: Sequence[Link],
- plan: FamilyLikelihoodPlan,
Differentiate observed predictor curvature along one predictor path.
- cdf(
- y: NDArray,
- theta: NDArray,
P(Y <= y)per row: shape1/cv^2and scalemean cv^2.
- quantile(
- p: NDArray,
- theta: NDArray,
The
p-quantile per row,pinside(0, 1).
- expected_shortfall(
- p: NDArray,
- theta: NDArray,
E[Y | Y > q_p]for shape1 / cv^2at unit prior weight.
- variance(
- theta: NDArray,
Var(Y) = (mean cv)^2per row at unit prior weight.
- variance_prior_weighted(
- theta: NDArray,
- weights: NDArray,
Var(Y) = (mean cv)^2 / wper row: shapew / cv^2, scalemean cv^2 / w.
- cdf_prior_weighted(
- y: NDArray,
- theta: NDArray,
- weights: NDArray,
P(Y <= y)per row: shapew / cv^2and scalemean cv^2 / w.
- quantile_prior_weighted(
- p: NDArray,
- theta: NDArray,
- weights: NDArray,
The prior-weighted
p-quantile per row,pinside(0, 1).
- expected_shortfall_prior_weighted(
- p: NDArray,
- theta: NDArray,
- weights: NDArray,
E[Y | Y > q_p]for weighted shapew / cv^2.