GaussianLS#

class superglm.GaussianLS(scale_floor: float = 0.01)#

Bases: LocationPredictor, ScalePredictor

Gaussian responses with separate mean and standard-deviation predictors.

Declare family.location(...) for the conditional mean and family.scale(...) for the standard deviation. Location uses an identity link. Scale uses log(scale - scale_floor). Results use the column names location and scale in that order.

Parameters:
scale_floorfloat, default=0.01

Nonnegative lower bound on the standard deviation, in response units. Fitted scale values stay strictly above this bound.

See also

SuperLSS

Construct and fit a model with these predictors.

to_config() → dict[str, Any]#

Return JSON-safe complete family configuration.

predictor_curvature_directional_derivative(
y: NDArray,
eta: NDArray,
eta_direction: NDArray,
links: Sequence[Link],
plan: FamilyLikelihoodPlan,
) → NDArray[float64]#

Differentiate observed predictor curvature along one predictor path.

cdf(
y: NDArray,
theta: NDArray,
) → NDArray[float64]#

P(Y <= y) per row from (location, scale).

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

The p-quantile per row from (location, scale), p inside (0, 1).

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

E[Y | Y > q_p] for the unit-weight Gaussian row law.

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

Var(Y) = sigma^2 per row at unit prior weight.

variance_prior_weighted(
theta: NDArray,
weights: NDArray,
) → NDArray[float64]#

Var(Y) = sigma^2 / w per row: the prior weight scales the variance.

cdf_prior_weighted(
y: NDArray,
theta: NDArray,
weights: NDArray,
) → NDArray[float64]#

P(Y <= y) per row when a prior weight scales the variance to sigma^2 / w.

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

The prior-weighted p-quantile per row, p inside (0, 1).

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

E[Y | Y > q_p] when the prior weight scales variance by 1 / w.