Skip to content

Log-space Taylor override hook + API-docs reorg - #3

Merged
thisiscam merged 2 commits into
mainfrom
examples-and-docs
May 24, 2026
Merged

thisiscam merged 2 commits into
mainfrom
examples-and-docs

Conversation

@thisiscam

Copy link
Copy Markdown
Owner

Follow-ups after #2 (two commits).

1. Log-space generator_taylor_coefficients override

Adds Copula.log_generator_taylor_coefficients(t, k_max) returning (sign, log|c|) for the normalized Taylor coefficients c_k = ψ^(k)(t)/k!. The Bell density already consumes coefficients as (sign, log|c|) internally, so a family whose series is computed in the log domain (e.g. AMH's Geometric-frailty logsumexp) can feed them straight in instead of exponentiating to a possibly-overflowing float64 only for bell to take the log again. bell._root_assembly now prefers this hook → linear generator_taylor_coefficients → jet.

Verified (AMH, flat copula, θ=0.5): the log override reproduces the linear override's log-likelihood to machine precision across d=8–50, while plain jet drifts at d=30 and is wrong at d=50 — i.e. it matches the paper's AMH precision result. Regression test in tests/test_log_taylor_override.py (fast: 2 passed in ~2s).

2. API-reference reorganization + install fix

  • mkdocstrings: hide private/dunder members, Args/Returns as tables, symbol-type headings + TOC, no source dumps, drop merge_init (was leaking CompiledModel's private dataclass fields).
  • api.md: restructured into Defining a copula / Compiling & evaluating / Composition registry / Configuration / Advanced (the generator-precision override hooks, grouped + explained — generator_taylor_coefficients recommended; log_generator_kth_derivative flagged legacy single-layer).
  • README + docs/index.md: corrected install — pip install (incl. git+…) does not work yet (ignores the [tool.uv] oryx pin); documents uv-from-source; PyPI gated on an upstream oryx release for jax 0.8.

mkdocs build --strict clean; llms.txt generates.

thisiscam added 2 commits May 24, 2026 12:58
Adds `Copula.log_generator_taylor_coefficients(t, k_max)` returning
`(sign, log|c|)` for the normalized Taylor coefficients c_k = ψ^(k)(t)/k!.

The Bell density already consumes coefficients as (sign, log|c|) internally,
so a family whose closed-form series is computed in the log domain (e.g. AMH's
Geometric-frailty logsumexp) can feed them straight in — instead of
exponentiating to a possibly-overflowing float64 only for bell to take the log
again. bell._root_assembly now prefers this hook, then the linear
generator_taylor_coefficients, then jet.

Verified on AMH (flat copula, θ=0.5): the log override reproduces the linear
override's log-likelihood to machine precision across d=8..50, while plain jet
drifts at d=30 and is wrong at d=50 — i.e. the log hook matches the paper's
AMH precision result. Regression test in test_log_taylor_override.py.
- mkdocstrings: hide private/dunder members, Args/Returns as tables,
  symbol-type headings + TOC, no source dumps, drop merge_init (leaked
  CompiledModel private dataclass fields). API page renders in clean
  curated sections.
- api.md: restructure into Defining a copula / Compiling & evaluating /
  Composition registry / Configuration / Advanced (generator-precision
  override hooks grouped + explained).
- index.md + README.md: fix install — pip install (incl. git+) does not
  work (ignores the [tool.uv] oryx pin); document uv-from-source; PyPI
  gated on an upstream oryx release for jax 0.8.
@thisiscam
thisiscam merged commit e47e64a into main May 24, 2026
0 of 3 checks passed
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