Skip to content

feat: add likelihood-function, estimated-CDF, and potential/observed-outcome macros - #71

Merged
d-morrison merged 4 commits into
mainfrom
claude/macros-backlog-clearance-xmjb6d
Jul 1, 2026
Merged

d-morrison merged 4 commits into
mainfrom
claude/macros-backlog-clearance-xmjb6d

Conversation

@d-morrison

Copy link
Copy Markdown
Owner

Clears the open-issue backlog (issue #56 intentionally left out of scope). Each issue is a separate commit; every new macro has a matching interpretations.tsv entry, so the macros-table.qmd build still passes.

#64 — likelihood / log-likelihood function forms

Macro Expands to Meaning
\Likf{x} \Lik(x) likelihood function, ℒ(·)
\loglikf{x} \llik(x) log-likelihood function, ℓ(·) (alias of \llikf)
\loglf{x} \llik(x) log-likelihood function (alias of \llikf)
\likf{x} \llik(x) log-likelihood function (alias of \llikf)

Completes the function-form family for the existing \Lik / \llik symbols. The lowercase-\lik-means-log-likelihood convention is pre-existing (\lik is already an alias of \llik); the TSV entries flag each alias accordingly.

#69 — estimated CDF function macros

Macro Expands to Meaning
\cdff{x} \cdf(x) CDF applied to argument, F(·)
\hcdf estimated CDF symbol
\hcdff{x} \hcdf(x) estimated CDF applied to argument, F̂(·)

Mirrors the existing \Q/\Qf/\hQ/\hQf and \surv/\survf/\hsurv/\hSurvf distribution-function families; \hcdf uses the same \mathop{\hat{…}}\nolimits pattern as \hsurv.

#70 — potential-outcome vs observed-outcome notation

Following the convention in the issue — subscripts for potential (intervened) exposures, parentheses for observed exposures:

Macro Expands to Meaning
\potout{a} Y_a potential outcome under exposure a
\potprob{a} π_a potential outcome probability (e.g. Pr(Y_a = 1) for binary Y)
\potmean{a} μ_a potential outcome mean (e.g. E[Y_a])
\obsprob{a} π(a) observed outcome probability
\obsmean{a} μ(a) observed outcome mean

These reuse the existing \prob (π) and \mean (μ) symbols, so they are notation variants of existing estimands rather than a new estimand group, and need no separate hat-wrapped estimators.

Verification

  • Replicated the macros-table.qmd build check: every new macro has an interpretations.tsv entry (no missing/orphan entries; no name collisions).
  • Loaded the full macros.qmd into a lualatex preamble and rendered every new macro to PDF — all produce the intended symbols (ℒ(θ), ℓ(θ), F(x), F̂, F̂(x), Y_a, π_a, μ_a, π(a), μ(a)).
  • Re-rendered demo-shortcode.qmd to PDF to confirm the include-shortcode path still loads macros.qmd cleanly.

Full HTML render via CI (Quarto Preview), since DT/knitr aren't installable against the container's bleeding-edge R.

Closes #64
Closes #69
Closes #70


Generated by Claude Code

claude added 3 commits June 30, 2026 23:09
Add \Likf (likelihood function, ℒ(·)) and \loglikf / \loglf / \likf as
log-likelihood function aliases of the existing \llikf, completing the
function-form family for the likelihood and log-likelihood symbols.

Each new macro has a matching interpretations.tsv entry.

Closes #64

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Dv2xDZnATLy84rCSUzrSn
Add \cdff (CDF applied to argument, F(·)), \hcdf (estimated CDF symbol,
F̂), and \hcdff (estimated CDF applied to argument, F̂(·)), following the
existing \Q/\Qf/\hQ/\hQf and \surv/\survf/\hsurv/\hSurvf function families.

Each new macro has a matching interpretations.tsv entry.

Closes #69

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Dv2xDZnATLy84rCSUzrSn
Add notation for causal-inference estimands, following the convention
requested in #70 — subscripts for potential (intervened) exposures and
parentheses for observed exposures:

  \potout{a}  -> Y_a    potential outcome under exposure a
  \potprob{a} -> pi_a   potential outcome probability (Pr(Y_a = 1))
  \potmean{a} -> mu_a   potential outcome mean (E[Y_a])
  \obsprob{a} -> pi(a)  observed outcome probability
  \obsmean{a} -> mu(a)  observed outcome mean

Each new macro has a matching interpretations.tsv entry.

Closes #70

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Dv2xDZnATLy84rCSUzrSn
Copilot AI review requested due to automatic review settings June 30, 2026 23:21

Copy link
Copy Markdown
Owner Author

Opened and actively iterating this PR to clear the #64/#69/#70 macro backlog (#56 intentionally left out of scope). Driving it to clean via ARDI — paws off until I'm done.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds several new LaTeX macros to macros.qmd to complete common notation “families” (function-form likelihood/log-likelihood, estimated CDF, and potential/observed outcome notation), and updates interpretations.tsv so the macros-table.qmd render check continues to pass.

Changes:

  • Added \Likf plus log-likelihood function aliases (\loglikf, \loglf, \likf) to mirror existing \Lik / \llik symbols.
  • Added estimated CDF macros (\cdff, \hcdf, \hcdff) following the existing hat-wrapped distribution-function pattern.
  • Added potential vs observed outcome macros (\potout, \potprob, \potmean, \obsprob, \obsmean) consistent with the subscript-vs-parentheses convention described in the linked issue.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
macros.qmd Introduces the new likelihood/CDF/potential-outcome macros and aliases.
interpretations.tsv Adds interpretation rows for each new macro to keep the macros-table merge/check passing.

Pair each descriptive #70 macro with a terse alias, matching the corpus
convention of a descriptive canonical name plus a short form:

  \py  -> \potout    Y_a    potential outcome
  \ppi -> \potprob   pi_a   potential outcome probability
  \pmu -> \potmean   mu_a   potential outcome mean
  \opi -> \obsprob   pi(a)  observed outcome probability
  \omu -> \obsmean   mu(a)  observed outcome mean

(\pmean already denotes the population mean, so the potential-mean
shorthand is the symbol-based \pmu.) Each alias has a matching
interpretations.tsv entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Dv2xDZnATLy84rCSUzrSn

Copy link
Copy Markdown
Owner Author

Added short aliases for the potential/observed macros (per request):

Shorthand Canonical Renders
\py \potout Y_a
\ppi \potprob π_a
\pmu \potmean μ_a
\opi \obsprob π(a)
\omu \obsmean μ(a)

p = potential, o = observed, plus the symbol's letter-name. The potential-mean shorthand is \pmu (symbol-based) because \pmean is already the population mean. Each alias has a matching interpretations.tsv entry; verified the interpretation-completeness check and a lualatex render of all five.


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Fully clean and ready for your merge:

  • build-deploy (Quarto render — exercises all four macros.qmd consumption paths) — success
  • Copilot review — reviewed both files, no comments
  • @claude review — full pass on the head commit, no findings

No open review threads. Merges Closes #64, #69, #70; #56 intentionally left out of scope. Leaving the merge to you.


Generated by Claude Code

@d-morrison
d-morrison merged commit b1bf86f into main Jul 1, 2026
2 checks passed
@d-morrison
d-morrison deleted the claude/macros-backlog-clearance-xmjb6d branch July 1, 2026 22:07
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants