name: discrete-and-count-models
description: "Use statsmodels discrete choice and count model APIs for Logit,
Probit, MNLogit, OrderedModel, Poisson, NegativeBinomial, zero-inflated,
hurdle, truncated, conditional models, marginal effects, and convergence
troubleshooting."
disable-model-invocation: true
metadata:
disco-role: operating
license: BSD 3-Clause
Discrete and count models
Use this sub-skill for binary choice, multinomial choice, ordered outcomes, count models, zero-inflated/hurdle/truncated counts, conditional models, marginal effects, post-estimation prediction, and failures such as perfect separation or non-convergence.
Workflow
- Identify the outcome type: binary, ordered categorical, unordered multinomial, nonnegative count, overdispersed count, zero-inflated/hurdle, truncated, or grouped conditional.
- Build
endog and exog, adding a constant for array APIs. Formula wrappers exist for common classes through statsmodels.formula.api.
- Fit the simplest defensible model first; only then add overdispersion, inflation, truncation, or conditional structure.
- Inspect convergence, parameter magnitudes, predicted probabilities/means, and marginal effects. For broad hypothesis tests or residual diagnostics, cross-route to statistical-tests-and-diagnostics.
Read or run
Boundaries
- Use linear-and-formula-models for GLM setup unless the task explicitly needs discrete-model-specific post-estimation, marginal effects, zero inflation, truncation, or choice-model classes.
- Use time-series-analysis for time-indexed discrete models only when the time-series structure is the core request.
- Use datasets-results-graphics for result export, tables, or plots after fitting.