LogNormalLS#

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

Bases: MeanPredictor, LocationPredictor, ScalePredictor

Log-normal with natural parameters (mean | location, scale).

log Y ~ N(mu, sigma^2) on y > 0. The default mean form puts E[Y] first under a log link, so its relativities multiply the mean and the scale predictor only redistributes mass within a cell; the location form puts mu first under an identity link, where relativities multiply every quantile. The mean always exists, so neither form has an invalid region.

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

Choose the first modeled parameter. Use family.mean(...) for E[Y] or, in location form, family.location(...) for E[log Y]. Declare family.scale(...) in either form; scale is the standard deviation of the log response. Changing forms changes which quantity the first additive predictor describes.

scale_floorfloat, default=0.01

Nonnegative lower bound on scale. Its default link is log(scale - scale_floor).

Notes

Fit the positive response directly. Results contain mean, scale or location, scale according to the selected form. predict returns the response mean in both forms.

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

Var(Y) = E[Y]^2 (exp(sigma^2) - 1) per row, in either parametrisation.

There is no prior-weighted companion: the log-normal is not a reproductive family, so this family refuses non-unit prior weights at the fit and has no weighted law to report a second moment from.

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

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