Repository navigation
Add information_curve and minimum_adequate_information (#240) - #241
Merged
Merged
Conversation
The stratified held-out bound of model_information per design size from replicate rows of log q(truth | y), with optional Bonferroni intervals, the smallest size reaching a target in nats or as a fraction of H(M), and a monotone_above flag.
Collaborator
Author
|
Independent review (read-only agent): approve, no edits requested. CI green on all jobs. Merging with the owner's admin override as authorised. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #240. Builds on #238 / #239 (merged).
What
information_curve(results, log_score, truth, along, labels, *, prior, confidence, adjustment): from raw replicate rows (one held-out replicate per row;trutha configuration factor,log_scorethe observablelog q(truth | y)), groups by the other factors and by the ordered sizealongand returns, per stratum, the stratified bound ofmodel_informationat every size with its interval (optionally Bonferroni across the scanned sizes), in nats, with per-structure counts.InformationCurve,InformationPoint.minimum_adequate_information(curves, target, *, rule="lower_bound" | "estimate", fraction=False): the smallest size that reachestargetnats (or a fraction ofH(M)), withmonotone_aboveas inAdequateDesign.AdequateInformation.model_information(_stratified;mean_probabilityisnanwhen only log scores are supplied).Conditions (docstrings and
docs/api/information.md)Those of
model_informationper size, plus: scores must be finite and at most 0 (a failed replicate is scored by the caller, for example with the log of the prior probability of its structure, never dropped); the probability floor is the caller's responsibility; the lower end of a marginal interval holds at the selected size only, andmonotone_abovereports a curve that dips after the selection; a selected size is a statement about the simulated structures and the grid, to be confirmed with fresh replicates.Validation
niidN(+-mu, 1)draws with the exact reader on their sum, for whichI(M; Y)at sizenequals the one-observation information atmu * sqrt(n)(quadrature). The curve is within 4 standard errors of the exact value at sizes 1, 4, 16 and 64 with 40,000 replicates per structure, and increasing.model_informationon the same replicates; strata are separate curves; Bonferroni widens; a non-monotone curve is flagged; unreachable targets giveNone; 10 refused-input cases plus unorderable sizes and invalid arguments.mypy --strict, strict docs build, doctests and the information tests; the full suite runs in CI.