Skip to content

formulas: families poisson/binomial/negative_binomial/cumulative compile to undefined observe-families (CompileError) #41

Description

@aaronstevenwhite

Summary

Several quivers.formulas response families compile to observe-family names that the DSL _FAMILY_REGISTRY does not define, so fit(..., family=...) fails at compile time. The quivers.formulas module docstring also advertises families (Poisson / NegBin / Cumulative / hurdle / mixture) that are not backed.

Affected families (src/quivers/formulas/family.py)

family key observe_family in DSL _FAMILY_REGISTRY?
poisson Poisson no
binomial Binomial no
negative_binomial NegativeBinomial no
cumulative OrderedLogistic no

The released DSL registry (quivers.dsl.compiler._get_family_registry()) backs only: Bernoulli, Categorical, Normal, Beta, Gamma, StudentT, the continuous loc-scale / positive / (0,1) families, Dirichlet, MVN, etc. No Poisson / Binomial / NegativeBinomial / OrderedLogistic.

Repro (the OrderedLogistic case is directly verifiable in the DSL, 0.13.0)

from quivers.dsl import loads
loads("""
object Resp : FinSet 10
program m : Resp -> Resp
    sample eta <- Normal(0.0, 1.0)
    let cutpoints = zeros(4)
    observe y : Resp <- OrderedLogistic(eta, cutpoints)
    return y
export m
""")
quivers.dsl.compiler.CompileError: line 6, col 4: undefined morphism or distribution family 'OrderedLogistic'

The formula path (fit(formula, data, family="cumulative")) routes through the same compiler, so it raises the same error. family="poisson" | "binomial" | "negative_binomial" fail identically (registry has no matching family).

Expected

Either (a) register the corresponding observe families so the declared formula families compile, or (b) remove the unsupported entries from families and trim the quivers.formulas.__init__ docstring so it only lists families that actually compile.

Notes

  • OrderedLogistic/cumulative-link is the one most likely to be missed — ordinal responses are common. A workaround is cutpoints + Categorical(probs) with probs built from sigmoid(c_k - eta) differences, but a first-class OrderedLogistic family would be the clean fix.
  • Still present on main (HEAD 4fefe49): poisson / negative_binomial / cumulative have no registered backing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions