TweedieProfileResult#

class superglm.TweedieProfileResult(p_hat: float, phi_hat: float, nll: float, converged: bool, fit_mode: str, evaluations: ~pandas.DataFrame, warnings: list[str], search_nll: float, _objective: ~typing.Any, _ll_scale: float, _ci_bounds: tuple[float, float], _ci_cache: dict[float, ~superglm.profiling._scalar.Interval] = <factory>, search_fit_mode: str | None = None, _caution: str | None = None, _candidates: dict[float, ~superglm.profiling.tweedie._Candidate] = <factory>, _ci_cautions: dict[float, list[str]] = <factory>)#

Bases: object

Profile-likelihood estimate of the Tweedie power p and dispersion phi.

nll is the mean negative log-likelihood of the published fit and search_nll the searched profile’s value at p_hat, which the interval and the plot measure against. evaluations lists every searched power in order; an infeasible power has nll = inf. fit_mode is the published fit’s regime and search_fit_mode the searched profile’s, which search_nll, the interval and the plot describe. The interval is inverted from the lowest point of that curve, which is p_hat unless an interval’s own evaluations found one lower by more than the fits’ own tolerances resolve; a caution then says so.

interval(
alpha: float = 0.05,
) → Interval#

Likelihood-ratio interval for p on the searched curve, with censoring flags.

A censored side, a winner whose fit did not settle, and what the interval’s own evaluations found (a fit that did not settle, or a power below p_hat’s value by more than the fits resolve) are recorded in warnings when first computed and warned about on every call.

ci(alpha: float = 0.05) → tuple[float, float]#

(lower, upper) of interval(); a censored side is where its search stopped.

profile_plot(alpha: float = 0.05, ax=None)#

Likelihood-ratio statistic over every evaluated power, with any computed interval.