OrderedLogistic loses precision in interior-category tail log probabilities
Maintainers usually reply within 3 days
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
Research direction
Start by locating the OrderedLogistic log-probability implementation and its tests; the issue does not name their paths. Reproduce the supplied middle-category tail case and compare it with the stable log-space expression in the body. Done when interior-category log probabilities remain accurate in both tails and gradients remain finite where representable.
Written by the indexing model from the issue text.
Description
OrderedLogistic subtracts nearly equal cumulative probabilities for interior categories. On posteriordb bones_model the Stan-minus-PyMC A/B delta residual is 6.8568890583264874e-6 (tolerance 1.1033592634095134e-6); an independent log-space evaluation of the same likelihood reduces it to about 2.3e-13. Recorded points.
Small tail case from the data (middle category, zero-based index 1):
import numpy as np
import pymc as pm
from scipy.special import log_expit
eta = 8.1123 * -5
cuts = 8.1123 * np.array([0.3887, 1.0153])
print(pm.logp(pm.OrderedLogistic.dist(eta=eta, cutpoints=cuts), 1).eval())
lo, hi = cuts - eta
print(log_expit(hi) + log_expit(-lo) + np.log(-np.expm1(lo-hi)))
The reference log probability is finite even when both float64 CDFs round to one. Prob need to evaluate interior category log probabilities stably in both tails, retaining finite gradients where representable.
PyMC 6.4.0, PyTensor 3.3.7
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 2.4k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pymc-devs/pymc
-
BUG: ZarrTrace fails in init_trace for models with datetime coordinates (object dtype coord array)Possibly taken @vladosskins178 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 3 days
-
BUG: DEMetropolis/DEMetropolisZ crash when vars is a subset of the model variablesPossibly taken @Souravrajvi0 claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 3 days
-
BUG: logp of pt.max/pt.min over a multi-dimensional i.i.d. variable has shape x.shape[1:] instead of being a scalarPossibly taken @saifmodan2006 claimed this 11 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pymc-devs/pymc#8635 · 2 comments ·
Maintainers usually reply within 3 days
-
ENH: permit cachetools >= 7May be free again @shupandee claimed this 9 days ago, and no pull request is open. Openfeature request
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
pymc-devs/pymc#8633 · 1 comment ·
Maintainers usually reply within 3 days
-
DOC: Document how to call `DifferentialEquation` in a model (`y0`, `theta`, output shape)Possibly taken @saheli56 claimed this 16 days ago. Opendocs
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
pymc-devs/pymc#8616 · 3 comments ·
Maintainers usually reply within 3 days
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
meetecho/juturna_nodes#43 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
TigreGotico/text2spoken#726 ·
Maintainers usually reply within 1 day
-
bug dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
nolte/claude-shared#822 ·
Maintainers usually reply within 1 day
-
`RequestHandler.build_request_kwargs` drops empty request bodies such as `{}` or `""`Possibly taken @abhirajadhikary06 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
typesense/typesense-python#170 ·
Maintainers usually reply within 1 day
-
claude-subscription-directsdk: tool calls with raw control characters in string values are droppedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NousResearch/hermes-official-plugins#538 ·
Maintainers usually reply within 3 days