drmTMB copyright and provenance notes

Except for the documented mesh/helper and normalized-GMRF adaptations below,
drmTMB contains no ported source code from gllvmTMB, glmmTMB, sdmTMB, brms, or
other modelling packages.

Future selective reuse of GPL-compatible A-inverse, SPDE, mesh, projection, or
TMB utility code must be recorded here before the reused code is treated as
complete.

## Package artwork

The logo files under `man/figures/` are original drmTMB artwork. They first
entered this repository in commit `69f11f82dd6da12a3b95dc3443315c93e4c9e666`
and were revised in commits `7399ec3a27d8efda481f69d1e8a170eda4b1d610`,
`c627d00a96e1ab40f8672fae72af13717c85cc24`, and
`8b5dc618037be9de7882a58d92c5fcb035a71ffb`, each authored by Shinichi
Nakagawa, drmTMB's listed author and maintainer. The SVG contains only paths,
text, and a system-font stack; it embeds no external font or third-party image
asset. The artwork is distributed under drmTMB's GPL (>= 3) package licence.

The public function map at
`vignettes/articles/function-map-cheatsheet.png` is the audited drmTMB Image
2.0 map restored at the maintainer's request on 2026-08-19. OpenAI Image 2.0
generated the base composition, icons, palette, and arrows from the prompt
recorded in
`docs/dev-log/figure-audits/2026-08-03-function-map/audit.md`. The repository's
`function-map-final-overlay.svg` applies deterministic, text-only corrections
to the generated base. The final PNG has SHA-256
`ad709c25d9942ed8e03b08d0e24ffece20f3161e81587e25b04dad12f287729d`.
The audit directory retains the prompt, generated base, overlay, render
evidence, checksums, and the Florence/Pat/Rose review verdicts. The final map
is distributed as drmTMB package documentation under the package's GPL
(>= 3) licence.

The printable assets under `pkgdown/assets/cheatsheets/` preserve the original
drmTMB function-map and two-page cheat-sheet designs. They are generated by
`tools/build-function-pdfs.py` with ReportLab from
`tools/function-cheatsheet-source.Rmd`: the map PDF embeds the audited PNG,
while the cheat-sheet PDF uses first-party text, layout, palette, and package
logo. The generator uses Arial installed on the build host when available;
ReportLab embeds subset ArialMT and Arial-BoldMT fonts in the cheat-sheet PDF.
No font source file is stored in this repository. The `pkgdown/` directory is
excluded from the R source package; these generated PDFs are distributed
through the documentation site under drmTMB's GPL (>= 3) package licence.

Spatial citation policy:

- If `drmTMB` implements SPDE/GMRF spatial fields from the published method but
  writes independent code, cite the method and relevant software in
  documentation, vignettes, and papers without listing a code provenance entry
  here.
- If `drmTMB` ports or closely adapts code from `gllvmTMB`, `sdmTMB`,
  `fmesher`, INLA-related sources, or another project, record the source file,
  license, and adaptation here in the same slice that introduces the code.

## Mesh/SPDE helper baseline (2026-08-02)

The mesh and geographic-coordinate helper contract is closely adapted from
gllvmTMB pull request #886, merged as
`01a3b1103e1b3fe5fdf5d27826349d5bc6f4f040` (GPL-3).  The reviewed source
baseline is `R/mesh.R`, `R/crs.R`, and their focused mesh/UTM tests at that
exact commit.  drmTMB adapts only the public-fmesher helper behaviour:
projected-coordinate validation, explicit longitude/latitude transformation,
finite-element matrices, and sparse observation-to-mesh projection.

drmTMB does not adapt gllvmTMB's multivariate latent-variable, slope-field,
anisotropy, barrier, or spatiotemporal machinery.  It also does not copy
sdmTMB source: sdmTMB is a possible post-implementation comparator and a
courtesy acknowledgement, not a dependency or code provenance entry.

## Normalized mesh GMRF density (2026-08-02)

The normalized TMB expression for the mesh field prior is closely adapted from
gllvmTMB merge `01a3b1103e1b3fe5fdf5d27826349d5bc6f4f040`, GPL-3,
`src/gllvmTMB.cpp` lines 1562--1591.  The originating gllvmTMB implementation
commit is `12a93bae77bc7feb74ea8f46d892d795fda5d2e1`.  drmTMB adopts the native
`density::SCALE(density::GMRF(Q, true), scale)` construction while retaining
its independently designed univariate Gaussian fit plumbing and fixed-kappa
mesh contract.

The scale translation is intentional: gllvmTMB parameterizes a positive
precision multiplier `tau` and supplies `1 / tau` to `SCALE`; drmTMB
parameterizes the covariance-scale multiplier `s = exp(log_sd)` directly and
supplies `s`.  Both give covariance `s^2 Q^-1` after identifying
`s = 1 / tau`.  No gllvmTMB range, multivariate, slope, non-Gaussian,
anisotropy, barrier, or spatiotemporal implementation is adopted here.

## Binomial link generalisation -- probit/cloglog dispatch and log-pnorm (2026-08-09)

Two things are adapted from gllvmTMB commit `431e173f7198f74c356ec3099ffa211f1ee85fd0`
(GPL-3), per `docs/design/252-binomial-link-generalisation.md`:

1. The link-DISPATCH PATTERN (not the numerics): gllvmTMB's `family_to_id()`
   at `R/fit-multi.R:441-450`/`:375-`(`switch(f$link, logit = 0L, probit = 1L,
   cloglog = 2L, ...)`) and the paired C++ `DATA_IVECTOR(link_id_vec)` /
   `if (lid == 0) ... else if (lid == 1) ... else if (lid == 2)` dispatch at
   `src/gllvmTMB.cpp:2185-2196` motivate drmTMB's `link_code` integer
   (0 = logit, 1 = probit, 2 = cloglog) plumbed as a single `DATA_INTEGER`
   alongside the existing `model_type == 18` binomial family tag.

2. The tail-safe log-scale normal CDF `drm_log_pnorm()` in `src/drm_numeric.h`
   is closely adapted from gllvmTMB's `gll_log_pnorm()` at
   `src/gllvmTMB.cpp:112-146` (Mills-ratio asymptotic expansion below x = -20,
   direct `log(pnorm(x))` above it).

drmTMB deliberately does NOT adopt gllvmTMB's probability-scale clamp
(`gll_clamp(p, 1e-12, 1 - 1e-12)` before `dbinom()`, `src/gllvmTMB.cpp:2196-2199`).
That clamp is a downgrade against drmTMB's existing log-scale `logspace_add`
binomial path: every drmTMB binomial link (logit, probit, cloglog) is
evaluated as `log(mu)`/`log(1-mu)` on the log scale throughout
(`drm_binom_log_mu()` in `src/drm_numeric.h`), with no probability-scale
floor or ceiling. `drm_binom_log_mu_eta()` (the `log|dmu/deta|` primitive for
the MSPL Jeffreys weight) is independently derived, not adapted from
gllvmTMB, which has no MSPL-style penalty.
