Skip to content

Add README and vignettes - #16

Merged
nickreich merged 5 commits into
mainfrom
nr/docs/6
Sep 3, 2026
Merged

nickreich merged 5 commits into
mainfrom
nr/docs/6

Conversation

@nickreich

Copy link
Copy Markdown
Member

The last of the port: a README with runnable examples and two vignettes.

The original package documented itself thinly — roughly twenty of its help
topics had empty @examples blocks, and many had empty @param and @return
tags. Its two vignettes were the real specification, and both depended on
library(tidyverse) to work at all.

Contents

README.Rmd with live hubExamples examples: scoring hub model output,
per-target detail, allocating without scoring, and the core API for use outside
the hubverse. README.md is generated from it and reproduces byte for byte on a
fresh render.

vignette("alloscore2") — the overview. It starts with why an allocation
score differs from a per-forecast score: because the budget is shared, a model
is rewarded for getting the relative burden across targets right, and can be
well calibrated at every location individually while still allocating badly.
Then: scoring hub output, choosing what shares a budget, per-target costs, the
asymmetry parameter alpha, inspecting the lambda search, score decomposition,
and the Monte Carlo path.

It closes with the caveats a user needs, rather than leaving them to be
discovered:

vignette("zxh-newsvendor") — the validation vignette. Reproduces the
published optima of both Zhang, Xu and Hua (2009) examples, including the
bounded-support beta case, and compares objective values rather than just
allocation vectors, since the problem can have near-flat optima.

Verified locally

R CMD check: Status: OK, including "re-building of vignette outputs".
456 tests, 0 failures, 0 warnings, 0 skips. lintr: 0 lints.
air format . --check: clean.

Rebased onto main after #15, so no workflow files appear in the diff.

nickreich and others added 2 commits September 2, 2026 17:42
Documentation, which the original package largely lacked: roughly twenty of
its help topics had empty `@examples` blocks and many had empty `@param` and
`@return` tags.

* `README.Rmd` with runnable `hubExamples` examples.
* `vignette("alloscore2")` explains what an allocation score is and why a shared
  budget rewards getting the relative burden across targets right, then walks
  through scoring hub output, choosing what shares a budget, per-target costs,
  the asymmetry parameter, and the Monte Carlo path. It closes with the known
  caveats: quantile output only, the `eps_K` tolerance that lets a score go
  slightly negative, and the inflated oracle allocation for generous budgets.
* `vignette("zxh-newsvendor")` is the validation vignette, reproducing the
  published optima of both Zhang, Xu and Hua examples and comparing objective
  values rather than just allocation vectors.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub Pages serves this repository at https://reichlab.io/alloscore2/, and
other reichlab packages declare that host: distfromq uses
http://reichlab.io/distfromq/ in both DESCRIPTION and _pkgdown.yml. The
previous value, https://reichlab.github.io/alloscore2/, resolves only by
redirect.

This matters beyond tidiness because pkgdown bakes its `url` into canonical
link tags, Open Graph metadata and the search index, so a non-canonical value
makes the published site advertise the wrong host.

Uses https rather than the http that distfromq declares; the custom domain
serves https with a valid certificate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread DESCRIPTION Outdated
nickreich and others added 3 commits September 3, 2026 13:30
Vignette edits: acknowledgments for both vignettes, a tour of the
hubExamples data being scored, prose for kappa, the cdf list column,
negative scores, the shadow price, and readings of the weighting,
alpha and per-target-component results.

README gains a Getting started section pointing at
vignette("alloscore2"), carrying both the console form and the pkgdown
URL so the link works on GitHub too. README.md re-rendered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The old sentence applied the weighted cost formula to all six rows, but
it holds only for the three with location 48 priced at 5. Say what each
group of rows actually spends.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Retitle the development NEWS section as the 0.1.0 release, and lift the
four entries that were not bug fixes — the ported plotting functions,
the hubverse layer, the README and vignettes, and the equivalence
result — out of the bug-fix section they had collected in.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nickreich

Copy link
Copy Markdown
Member Author

I walked through the vignettes and it all looks good to me.

@nickreich
nickreich merged commit abbaffd into main Sep 3, 2026
9 checks passed
@nickreich
nickreich deleted the nr/docs/6 branch September 3, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant