LogNormalLS#
- class superglm.LogNormalLS( )#
Bases:
MeanPredictor,LocationPredictor,ScalePredictorLog-normal with natural parameters
(mean | location, scale).log Y ~ N(mu, sigma^2)ony > 0. The default mean form putsE[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 putsmufirst 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(...)forE[Y]or, in location form,family.location(...)forE[log Y]. Declarefamily.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, scaleorlocation, scaleaccording to the selected form.predictreturns the response mean in both forms.- variance(
- theta: NDArray,
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,
E[Y | Y > q_p]per row in either natural parametrisation.