Skip to content

Ordered and Zero-Inflated Families

Ordered families model ranked outcomes, such as low, medium, and high, through thresholds on a linear predictor (McCullagh, 1980). The zero-inflated and hurdle families model extra zero outcomes (Mullahy, 1986; McLachlan and Peel, 2000): their parameters give the probability of the zero branch and the distribution on the other branch. Their log probabilities are computed with the stable methods of (Mรคchler, 2012).

For a proportion that may equal zero or one, an inflated beta distribution combines point masses at the endpoints with a density between them (Ospina and Ferrari, 2010). An endpoint probability and an interior density are different quantities, and each contribution is scored against its own measure, discrete or continuous.

Discrimination defaults to one and must be finite and strictly positive. The formula frontend additionally provides cumulative, adjacent-category, stopping-ratio, continuation-ratio, and hurdle-cumulative constructions through a shared log-probability kernel. Their ordinal guide and formal laws distinguish cumulative threshold ordering from unconstrained noncumulative thresholds and identify the hurdle response codes.

The module gives ordered categorical families, conditional and inline, and the zero-inflated, hurdle, and mixture distributions that PyTorch does not include.

ordered

Cutpoint-parameterised ordered-categorical morphisms.

Ordered-categorical distributions assign probability mass to a discrete set of ordered categories {0, 1, ..., K-1} via a latent real-valued eta and K - 1 cutpoints c_0 < c_1 < ... < c_{K-2}. The cumulative probability of landing at or below category k is CDF(c_k - eta), where CDF is either the logistic or the standard normal cumulative distribution function:

P(Y <= k | eta, c) = CDF(c_k - eta)         for 0 <= k < K - 1
P(Y = k | eta, c) = CDF(c_k - eta) - CDF(c_{k-1} - eta)
P(Y = 0 | eta, c) = CDF(c_0 - eta)
P(Y = K - 1 | eta, c) = 1 - CDF(c_{K-2} - eta)

The cutpoints argument is supplied at call time as a 1-D tensor of length K - 1, allowing the same morphism to be reused with different cutpoint vectors across observations or models.

Sampling is non-reparameterisable: the support is discrete.

ConditionalOrderedLogistic

ConditionalOrderedLogistic(domain: AnySpace, codomain: AnySpace, num_categories: int, hidden_dim: int | Sequence[int] | None = None, param_source: ParamSource | None = None, param_source_option: str | None = None)

Bases: _ConditionalOrdered

Conditional ordered-logistic over num_categories ordered classes.

The latent eta(x) is computed by the parameter source. Given a vector of num_categories - 1 ordered cutpoints supplied at call time, the probability of category k is

P(Y = k) = sigmoid(c_k - eta) - sigmoid(c_{k-1} - eta)

with the conventions sigmoid(c_{-1} - eta) = 0 and sigmoid(c_{K-1} - eta) = 1.

PARAMETER DESCRIPTION
domain

Source space.

TYPE: SetObject or ContinuousSpace

codomain

Target space; semantically the set of ordered categories.

TYPE: SetObject or ContinuousSpace

num_categories

Number of ordered categories K >= 2.

TYPE: int

hidden_dim

Hidden layer width for the neural parameter source.

TYPE: int DEFAULT: None

Source code in src/quivers/continuous/ordered.py
def __init__(
    self,
    domain: AnySpace,
    codomain: AnySpace,
    num_categories: int,
    hidden_dim: int | Sequence[int] | None = None,
    param_source: ParamSource | None = None,
    param_source_option: str | None = None,
) -> None:
    if num_categories < 2:
        raise ValueError(
            f"ordered family requires num_categories >= 2; got {num_categories}"
        )
    super().__init__(domain, codomain)
    self._k = int(num_categories)
    self.param_source = _make_source(
        domain,
        1,
        hidden_dim,
        param_source=param_source,
        param_source_option=param_source_option,
    )

ConditionalOrderedProbit

ConditionalOrderedProbit(domain: AnySpace, codomain: AnySpace, num_categories: int, hidden_dim: int | Sequence[int] | None = None, param_source: ParamSource | None = None, param_source_option: str | None = None)

Bases: _ConditionalOrdered

Conditional ordered-probit over num_categories ordered classes.

Identical to :class:ConditionalOrderedLogistic but uses the standard normal cumulative distribution function in place of the logistic CDF.

PARAMETER DESCRIPTION
domain

Source space.

TYPE: SetObject or ContinuousSpace

codomain

Target space; semantically the set of ordered categories.

TYPE: SetObject or ContinuousSpace

num_categories

Number of ordered categories K >= 2.

TYPE: int

hidden_dim

Hidden layer width for the neural parameter source.

TYPE: int DEFAULT: None

Source code in src/quivers/continuous/ordered.py
def __init__(
    self,
    domain: AnySpace,
    codomain: AnySpace,
    num_categories: int,
    hidden_dim: int | Sequence[int] | None = None,
    param_source: ParamSource | None = None,
    param_source_option: str | None = None,
) -> None:
    if num_categories < 2:
        raise ValueError(
            f"ordered family requires num_categories >= 2; got {num_categories}"
        )
    super().__init__(domain, codomain)
    self._k = int(num_categories)
    self.param_source = _make_source(
        domain,
        1,
        hidden_dim,
        param_source=param_source,
        param_source_option=param_source_option,
    )

_ordered

Compatibility constructors for cumulative ordinal logit and probit distributions.

OrderedLogistic

OrderedLogistic(predictor: Tensor, cutpoints: Tensor, validate_args: bool | None = None)

Bases: OrdinalDistribution

Ordered-logit distribution over K = cutpoints.shape[-1] + 1 ordered categories indexed 0 .. K - 1.

With a real predictor eta and a sorted cutpoint vector c = (c_0 < c_1 < ... < c_{K-2}):

  • P(Y = 0) = sigmoid(c_0 - eta)
  • P(Y = k) = sigmoid(c_k - eta) - sigmoid(c_{k-1} - eta) for 0 < k < K - 1
  • P(Y = K - 1) = 1 - sigmoid(c_{K-2} - eta)

Cutpoint broadcasting:

  • Shared cutpoints c of shape (K - 1,) apply uniformly to every row.
  • Per-row cutpoints of shape (batch, K - 1) apply distinct thresholds per observation (the ordinal-mixed-model case).
  • Arbitrary leading batch shape is supported; the last axis is always the cutpoint axis.

Log probabilities are computed without forming the difference of sigmoids: with a < b the two cutpoint offsets bounding a category, sigmoid(b) - sigmoid(a) equals sigmoid(b) * sigmoid(-a) * (1 - exp(a - b)), so its log is a sum of two log-sigmoids and a log(1 - exp(.)) term, each accurate in both tails. A category far from the predictor thus keeps its exact log probability rather than one floored at the smallest normal float.

PARAMETER DESCRIPTION
predictor

Finite real predictor with arbitrary batch dimensions.

TYPE: Tensor

cutpoints

Finite, strictly increasing thresholds with final dimension K-1.

TYPE: Tensor

validate_args

Whether to validate arguments and response codes.

TYPE: bool or None DEFAULT: None

References

McCullagh 1980.

Source code in src/quivers/continuous/_ordered.py
def __init__(
    self,
    predictor: Tensor,
    cutpoints: Tensor,
    validate_args: bool | None = None,
) -> None:
    super().__init__(
        predictor, cutpoints, link="logit", validate_args=validate_args
    )

OrderedProbit

OrderedProbit(predictor: Tensor, cutpoints: Tensor, validate_args: bool | None = None)

Bases: OrderedLogistic

Ordered-probit distribution over K = cutpoints.shape[-1] + 1 ordered categories indexed 0 .. K - 1.

The ordered-logistic construction with standard normal latent noise: P(Y <= k) = Phi(c_k - eta) for the standard normal distribution function Phi, so P(Y = k) = Phi(c_k - eta) - Phi(c_{k-1} - eta). Predictor and cutpoint broadcasting follow OrderedLogistic.

Log probabilities are computed without forming the difference of distribution functions: with a < b the offsets bounding a category, log(Phi(b) - Phi(a)) = log Phi(b) + log(1 - exp(log Phi(a) - log Phi(b))), and for a category above the predictor (a > 0) the same identity on the mirrored offsets -b < -a, since Phi(b) - Phi(a) = Phi(-a) - Phi(-b). Each term is accurate in both tails, so a category far from the predictor keeps its log probability.

PARAMETER DESCRIPTION
predictor

The real predictor eta.

TYPE: Tensor

cutpoints

The sorted cutpoints, (..., K - 1).

TYPE: Tensor

validate_args

Whether to validate arguments and values.

TYPE: bool | None DEFAULT: None

Source code in src/quivers/continuous/_ordered.py
def __init__(
    self,
    predictor: Tensor,
    cutpoints: Tensor,
    validate_args: bool | None = None,
) -> None:
    OrdinalDistribution.__init__(
        self, predictor, cutpoints, link="probit", validate_args=validate_args
    )

_zip_hurdle

Zero-inflated, hurdle, and Normal mixture families.

The inflation and Normal-mixture families compose probability measures. The hurdle family scores a normalized positive Poisson component directly, including its point-mass limit at rate zero.

ZeroInflatedPoisson

ZeroInflatedPoisson(zero_prob: Tensor, rate: Tensor, validate_args: bool | None = None)

Bases: _InflatedCount

Mixture([pi, 1-pi], [PointMass(0), Poisson(rate)]).

Total zero mass pi + (1-pi) * exp(-rate) per Lambert 1992; the count component is the unrestricted Poisson, so excess zeros come from both the structural-zero spike and the natural Poisson zeros. Contrast with HurdlePoisson in which the count component is zero-truncated.

Reference: Lambert 1992.

Source code in src/quivers/continuous/_zip_hurdle.py
def __init__(
    self,
    zero_prob: Tensor,
    rate: Tensor,
    validate_args: bool | None = None,
) -> None:
    self.zero_prob, self.rate = torch.broadcast_tensors(zero_prob, rate)
    super().__init__(
        batch_shape=self.zero_prob.shape,
        validate_args=validate_args,
    )

HurdlePoisson

HurdlePoisson(zero_prob: Tensor, rate: Tensor, validate_args: bool | None = None)

Bases: _CountCDF, Distribution

A point mass at zero mixed with a normalized positive Poisson.

A Bernoulli with probability 1 - zero_prob selects the positive component. At rate zero that component is the point mass at one, giving the continuous extension in the rate. Negative rates are refused. The disjoint supports permit direct scoring of each branch.

Reference: Mullahy 1986.

Source code in src/quivers/continuous/_zip_hurdle.py
def __init__(
    self,
    zero_prob: Tensor,
    rate: Tensor,
    validate_args: bool | None = None,
) -> None:
    self.zero_prob, self.rate = torch.broadcast_tensors(zero_prob, rate)
    super().__init__(
        batch_shape=self.rate.shape,
        validate_args=validate_args,
    )

mean property

mean: Tensor

The hurdle mean, with the positive component's limit at zero.

log_prob

log_prob(value: Tensor) -> Tensor

Score counts against the normalized hurdle distribution.

PARAMETER DESCRIPTION
value

Nonnegative integer observations.

TYPE: Tensor

RETURNS DESCRIPTION
Tensor

Log probabilities broadcast over observations and parameters.

RAISES DESCRIPTION
ValueError

If validation is enabled and an observation is outside the support.

Source code in src/quivers/continuous/_zip_hurdle.py
def log_prob(self, value: Tensor) -> Tensor:
    """Score counts against the normalized hurdle distribution.

    Parameters
    ----------
    value : Tensor
        Nonnegative integer observations.

    Returns
    -------
    Tensor
        Log probabilities broadcast over observations and parameters.

    Raises
    ------
    ValueError
        If validation is enabled and an observation is outside the support.
    """
    _check_count_observation_source(value)
    if self._validate_args:
        self._validate_sample(value)
    valid = _constraints.nonnegative_integer.check(value)
    value = value.to(torch.float64)
    rate, zero = self.rate.to(torch.float64), self.zero_prob.to(torch.float64)
    safe_value = torch.where(valid & (value > 0), value, 1.0)
    # Reuse the stable unrestricted count kernel. The one-count identity
    # retains the finite first/second rate derivatives at the zero limit.
    safe_rate = torch.where(rate > 0, rate, 1.0)
    conditioned = (
        ClosedPoisson(safe_rate, validate_args=False).log_prob(safe_value)
        - (-torch.expm1(-safe_rate)).log()
    )
    component = torch.where(
        safe_value == 1,
        -rate + positive_poisson_log_mean(rate),
        torch.where(rate > 0, conditioned, -torch.inf),
    )
    one = torch.ones_like(rate)
    positive = _count_log(one, 1 - zero) + component
    result = torch.where(value == 0, _count_log(one, zero), positive)
    return torch.where(valid, result, -torch.inf)

sample

sample(sample_shape: Size = Size()) -> Tensor

Draw counts using a conditioned first arrival for the positive branch.

PARAMETER DESCRIPTION
sample_shape

Dimensions prepended to the parameter batch shape.

TYPE: Size DEFAULT: Size()

RETURNS DESCRIPTION
Tensor

Nonnegative integer draws, including the rate-zero limit.

Source code in src/quivers/continuous/_zip_hurdle.py
def sample(self, sample_shape: torch.Size = torch.Size()) -> Tensor:
    """Draw counts using a conditioned first arrival for the positive branch.

    Parameters
    ----------
    sample_shape : torch.Size
        Dimensions prepended to the parameter batch shape.

    Returns
    -------
    Tensor
        Nonnegative integer draws, including the rate-zero limit.
    """
    with torch.no_grad():
        shape = self._extended_shape(sample_shape)
        probability = self.zero_prob.expand(shape)
        active = (
            torch.rand(shape, dtype=probability.dtype, device=probability.device)
            >= probability
        )
        result = torch.zeros(shape, dtype=torch.long, device=probability.device)
        if active.any():
            result[active] = positive_poisson_sample(
                self.rate.expand(shape)[active]
            ).long()
        return result

MixtureNormal

MixtureNormal(weights: Tensor, loc: Tensor, scale: Tensor, validate_args: bool | None = None)

Bases: Distribution

Mixture(weights, [Normal(loc_k, scale_k) for k]).

Same-family Gaussian mixture with K = weights.shape[-1] components. Mixing weights live in the K-simplex along the last axis; component means and scales also vary along the last axis and broadcast over the leading batch.

For mixing arbitrary families together, construct the Mixture directly with a list of heterogeneous components.

Reference: McLachlan & Peel 2000.

Source code in src/quivers/continuous/_zip_hurdle.py
def __init__(
    self,
    weights: Tensor,
    loc: Tensor,
    scale: Tensor,
    validate_args: bool | None = None,
) -> None:
    if weights.shape[-1] != loc.shape[-1]:
        raise ValueError(
            "MixtureNormal: weights and loc must agree on the "
            f"component axis (last dim); got weights={tuple(weights.shape)}, "
            f"loc={tuple(loc.shape)}"
        )
    if weights.shape[-1] != scale.shape[-1]:
        raise ValueError(
            "MixtureNormal: weights and scale must agree on the "
            f"component axis (last dim); got weights={tuple(weights.shape)}, "
            f"scale={tuple(scale.shape)}"
        )
    self.weights = weights
    self.loc = loc
    self.scale = scale
    self._num_components = int(weights.shape[-1])
    components = [
        torch.distributions.Normal(loc[..., k], scale[..., k])
        for k in range(self._num_components)
    ]
    self._mixture = Mixture(weights, components)
    super().__init__(
        batch_shape=self._mixture.batch_shape,
        event_shape=self._mixture.event_shape,
        validate_args=validate_args,
    )

recorded_event_log_prob

recorded_event_log_prob(value: Tensor, *, status: Tensor | int | None = None, interval_upper: Tensor | float | None = None, trunc_lower: Tensor | float | None = None, trunc_upper: Tensor | float | None = None) -> Tensor

Score a recorded event with each component truncated separately.

brms normalizes every mixture component on the truncation interval and then mixes the normalized components with the mixing weights. The score is log sum_k w_k P_k(event) / P_k(lower <= Y <= upper), and censoring alone reduces to the mass of the mixture. Cost: O(n K).

PARAMETER DESCRIPTION
value

Exact outcomes or first censoring endpoints.

TYPE: Tensor

status

Censoring codes -1 left, 0 exact, 1 right, 2 interval.

TYPE: Tensor or int or None DEFAULT: None

interval_upper

Upper endpoints of interval-censored rows.

TYPE: Tensor or float or None DEFAULT: None

trunc_lower

Inclusive truncation bounds.

TYPE: Tensor or float or None DEFAULT: None

trunc_upper

Inclusive truncation bounds.

TYPE: Tensor or float or None DEFAULT: None

RETURNS DESCRIPTION
Tensor

Unweighted log likelihoods per row.

Source code in src/quivers/continuous/_zip_hurdle.py
def recorded_event_log_prob(
    self,
    value: Tensor,
    *,
    status: Tensor | int | None = None,
    interval_upper: Tensor | float | None = None,
    trunc_lower: Tensor | float | None = None,
    trunc_upper: Tensor | float | None = None,
) -> Tensor:
    """Score a recorded event with each component truncated separately.

    brms normalizes every mixture component on the truncation interval and
    then mixes the normalized components with the mixing weights. The
    score is ``log sum_k w_k P_k(event) / P_k(lower <= Y <= upper)``, and
    censoring alone reduces to the mass of the mixture. Cost: O(n K).

    Parameters
    ----------
    value : Tensor
        Exact outcomes or first censoring endpoints.
    status : Tensor or int or None
        Censoring codes -1 left, 0 exact, 1 right, 2 interval.
    interval_upper : Tensor or float or None
        Upper endpoints of interval-censored rows.
    trunc_lower, trunc_upper : Tensor or float or None
        Inclusive truncation bounds.

    Returns
    -------
    Tensor
        Unweighted log likelihoods per row.
    """
    scores = torch.stack(
        [
            event_log_prob(
                component,
                value,
                status=status,
                interval_upper=interval_upper,
                trunc_lower=trunc_lower,
                trunc_upper=trunc_upper,
            )
            for component in self._components()
        ],
        dim=-1,
    )
    log_weights = torch.where(
        self.weights > 0,
        torch.where(self.weights > 0, self.weights, 1.0).log(),
        -torch.inf,
    )
    return torch.logsumexp(log_weights + scores, dim=-1)

componentwise_truncation

componentwise_truncation(lower: Tensor | float | None, upper: Tensor | float | None) -> Mixture

Mix the components after normalizing each on the truncation interval.

PARAMETER DESCRIPTION
lower

Inclusive truncation bounds; None leaves a side open.

TYPE: Tensor or float or None

upper

Inclusive truncation bounds; None leaves a side open.

TYPE: Tensor or float or None

RETURNS DESCRIPTION
Mixture

The brms truncated mixture, sampled by component then by the component's truncated Normal law.

Source code in src/quivers/continuous/_zip_hurdle.py
def componentwise_truncation(
    self, lower: Tensor | float | None, upper: Tensor | float | None
) -> Mixture:
    """Mix the components after normalizing each on the truncation interval.

    Parameters
    ----------
    lower, upper : Tensor or float or None
        Inclusive truncation bounds; None leaves a side open.

    Returns
    -------
    Mixture
        The brms truncated mixture, sampled by component then by the
        component's truncated Normal law.
    """
    return Mixture(
        self.weights,
        [
            Normalize(Restrict(component, lower, upper))
            for component in self._components()
        ],
    )

ZeroOneInflatedBeta

ZeroOneInflatedBeta(mu: Tensor, phi: Tensor, zoi: Tensor, coi: Tensor, validate_args: bool | None = None)

Bases: Distribution

Zero-one inflated beta distribution.

Mixture of point masses at 0 and 1 with a continuous Beta on (0, 1):

  • P(y = 0) = zoi * (1 - coi)
  • P(y = 1) = zoi * coi
  • P(0 < y < 1) = 1 - zoi
  • On the open interval, the density is (1 - zoi) times the density of Beta(mu * phi, (1 - mu) * phi).

Parameters follow the mean-precision Beta reparameterization and the brms zoi / coi inflation probabilities. The mean is strictly between zero and one, precision is positive, and inflation probabilities include both endpoints. Formula frontend emits ZeroOneInflatedBeta(mu, phi, zoi, coi).

For the distributional background, see Ospina and Ferrari (2010). The parameter convention follows the brms family documentation.

Source code in src/quivers/continuous/_zip_hurdle.py
def __init__(
    self,
    mu: Tensor,
    phi: Tensor,
    zoi: Tensor,
    coi: Tensor,
    validate_args: bool | None = None,
) -> None:
    self.mu, self.phi, self.zoi, self.coi = torch.broadcast_tensors(
        mu, phi, zoi, coi
    )
    batch_shape = self.mu.shape
    super().__init__(
        batch_shape=batch_shape,
        event_shape=torch.Size(),
        validate_args=validate_args,
    )

mean property

mean: Tensor

Expected response, including the atom at one and the interior mean.

RETURNS DESCRIPTION
Tensor

The atom-at-one contribution plus the weighted interior mean.

log_partial_first_moment

log_partial_first_moment(low: Tensor, high: Tensor, *, lower_closed: bool | Tensor = True, upper_closed: bool | Tensor = True) -> Tensor

Log of the first moment restricted to an interval.

The atom at zero adds nothing, the atom at one adds its mass when the interval holds one, and the interior adds 1 - zoi times the partial moment of the beta law, which is its mean times an interval mass of the beta law with its first shape raised by one.

PARAMETER DESCRIPTION
low

Float64 interval ends, possibly infinite.

TYPE: Tensor

high

Float64 interval ends, possibly infinite.

TYPE: Tensor

lower_closed

Endpoint membership, which decides whether an end at one holds the atom there.

TYPE: bool or Tensor DEFAULT: True

upper_closed

Endpoint membership, which decides whether an end at one holds the atom there.

TYPE: bool or Tensor DEFAULT: True

RETURNS DESCRIPTION
Tensor

Float64 log int_I y dF(y), negative infinity when the interval carries no positive response.

Source code in src/quivers/continuous/_zip_hurdle.py
def log_partial_first_moment(
    self,
    low: Tensor,
    high: Tensor,
    *,
    lower_closed: bool | Tensor = True,
    upper_closed: bool | Tensor = True,
) -> Tensor:
    """Log of the first moment restricted to an interval.

    The atom at zero adds nothing, the atom at one adds its mass when
    the interval holds one, and the interior adds ``1 - zoi`` times the
    partial moment of the beta law, which is its mean times an interval
    mass of the beta law with its first shape raised by one.

    Parameters
    ----------
    low, high : Tensor
        Float64 interval ends, possibly infinite.
    lower_closed, upper_closed : bool or Tensor
        Endpoint membership, which decides whether an end at one holds
        the atom there.

    Returns
    -------
    Tensor
        Float64 ``log int_I y dF(y)``, negative infinity when the
        interval carries no positive response.
    """
    beta = self._beta()
    interior = size_biased_log_moment(
        beta, low.clamp(0.0, 1.0), high.clamp(0.0, 1.0), True, True
    )
    assert interior is not None
    holds_one = ((low < 1) | ((low == 1) & torch.as_tensor(lower_closed))) & (
        (high > 1) | ((high == 1) & torch.as_tensor(upper_closed))
    )
    zoi, coi = self.zoi.double(), self.coi.double()
    return torch.logaddexp(
        _log_mass(1 - zoi) + interior,
        torch.where(holds_one, _log_mass(zoi * coi), -torch.inf),
    )

log_cdf_left

log_cdf_left(value: Tensor) -> Tensor

Evaluate log P(Y < value), excluding an atom at the query.

PARAMETER DESCRIPTION
value

Real query points.

TYPE: Tensor

RETURNS DESCRIPTION
Tensor

Float64 log left limits of the CDF.

Source code in src/quivers/continuous/_zip_hurdle.py
def log_cdf_left(self, value: Tensor) -> Tensor:
    """Evaluate ``log P(Y < value)``, excluding an atom at the query.

    Parameters
    ----------
    value : Tensor
        Real query points.

    Returns
    -------
    Tensor
        Float64 log left limits of the CDF.
    """
    return log_zero_one_inflated_beta_tails(
        self.mu, self.phi, self.zoi, self.coi, value, left=True
    )[0]

log_survival_function_left

log_survival_function_left(value: Tensor) -> Tensor

Evaluate log P(Y >= value), including an atom at the query.

PARAMETER DESCRIPTION
value

Real query points.

TYPE: Tensor

RETURNS DESCRIPTION
Tensor

Float64 log survival including the query point.

Source code in src/quivers/continuous/_zip_hurdle.py
def log_survival_function_left(self, value: Tensor) -> Tensor:
    """Evaluate ``log P(Y >= value)``, including an atom at the query.

    Parameters
    ----------
    value : Tensor
        Real query points.

    Returns
    -------
    Tensor
        Float64 log survival including the query point.
    """
    return log_zero_one_inflated_beta_tails(
        self.mu, self.phi, self.zoi, self.coi, value, left=True
    )[1]

Cited sources

Peter McCullagh. Regression Models for Ordinal Data. Journal of the Royal Statistical Society: Series B (Methodological), 42(2):109โ€“127, 1980. URL: https://academic.oup.com/jrsssb/article/42/2/109/7027621, doi:10.1111/j.2517-6161.1980.tb01109.x.

John Mullahy. Specification and Testing of Some Modified Count Data Models. Journal of Econometrics, 33(3):341โ€“365, 1986. URL: https://www.sciencedirect.com/science/article/abs/pii/0304407686900023, doi:10.1016/0304-4076(86)90002-3.

Geoffrey McLachlan and David Peel. Finite Mixture Models. Wiley, 2000. URL: https://onlinelibrary.wiley.com/doi/book/10.1002/0471721182, doi:10.1002/0471721182.

Martin Mรคchler. Accurately Computing log(1 - exp(-|a|)): Assessed by the Rmpfr Package. Technical note, CRAN, 2012. Document dated April and October 2012; typeset September 5, 2026. URL: https://cran.r-project.org/package=Rmpfr/vignettes/log1mexp-note.pdf.

Raydonal Ospina and Silvia L. P. Ferrari. Inflated Beta Distributions. Statistical Papers, 51:111โ€“126, 2010. URL: https://link.springer.com/article/10.1007/s00362-008-0125-4, doi:10.1007/s00362-008-0125-4.