Skip to content
José Mauricio Gómez Julián edited this page Jun 28, 2026 · 6 revisions

gdpar — Complete Technical Wiki

General Dynamic Parameter Models via Reference Anchoring

Package version: 0.1.0 · License: GPL (≥ 3) · Author: José Mauricio Gómez Julián (ORCID 0009-0000-2412-3150) · Repository: https://github.com/IsadoreNabi/gdpar


0. About this document

This is an exhaustive, self-contained technical reference for the gdpar R package. It documents, in three layers and at maximal depth:

  1. Conceptualization — the cognitive and statistical idea behind the framework, its desiderata, and the family of problems it addresses (Part I).
  2. Mathematics — the canonical decomposition, identifiability theory, the three estimation paths and their asymptotics, the distributional-family algebra, the spline bases, the causal-inference bridge, the geometry-adaptive sampling engine, and the dependence-robust inference machinery (Part II).
  3. Computation — how the mathematics is realized in code: the Stan code generator and every Stan template (line by line), the fitting engines, the family code generation, the geometry engine, and every one of the package's 469 functions organized by module (Parts III–V).

Parts VI and the appendices cover the bundled data, the benchmark harness, the test suite, the symbol glossary, and the bibliographic anchors.

0.1 How this document is organized

Part Content
I Conceptual framework: motivation, the anchoring equation, the AMM form, the three paths, EB vs FB, distributional regression, the causal bridge, geometric robustness, dependence-robust inference
II Mathematical foundations: AMM algebra, identifiability theorems (C1–C7), parametrizations (CP/NCP, linear reparametrization), asymptotics of Paths 1/2/3, Empirical-Bayes theory (Theorems 7A–7D) and its multivariate extension, families and links, B-spline W bases, grouped references, causal identification, geometric metrics, dependence diagnostics and block bootstrap
III Computational architecture: the Stan code generator, the fitting engines (gdpar, .gdpar_multi, .gdpar_K), the Empirical-Bayes engine, the family/codegen layer, the geometry engine/orchestrator
IV Exhaustive function reference: all 44 R source files, all 469 functions, grouped by module, each with purpose, signature, arguments, mathematics, and return value
V Stan templates: all 13 .stan files, block by block
VI Data, benchmarks, tests, appendices, references

0.2 Notation and conventions

Mathematics is written in GitHub-flavored LaTeX: inline as $ … $ and display as $$ … $$. Code identifiers, file names, and Stan symbols are in monospace. Internal (non-exported) R functions are named with a leading dot, e.g. .gdpar_multi; exported functions have no leading dot, e.g. gdpar.

The single most important object in the entire package is the reference-anchoring decomposition

$$\theta_i ;=; \theta_{\text{ref}} ;+; \Delta(x_i,; \theta_{\text{ref}}),$$

read throughout as: the parameter of individual $i$ equals a population reference plus a deviation that is itself a function of the individual's covariates and of the reference. Every layer of the package — conceptual, mathematical, computational — is an elaboration of this one equation.

0.3 Global symbol table

Symbol Meaning
$\theta_i$ parameter (vector) for individual / observation $i$
$\theta_{\text{ref}}$ population reference parameter, $\theta_{\text{ref}} = \mathbb{E}[\theta]$
$\Delta(x_i,\theta_{\text{ref}})$ individual deviation function
$x_i$ observable covariates of individual $i$
$a(x)$ additive component of the AMM deviation
$b(x)$ multiplicative (Hadamard) component of the AMM deviation
$W(\theta_{\text{ref}})$ reference-modulated mixing matrix of the AMM deviation
$\odot$ Hadamard (elementwise) product
$K$ number of distributional parameter slots (e.g. $\mu,\sigma,\nu,\pi,\dots$)
$p$ dimension of the parameter at a slot (number of coordinates of $\theta$)
$\mathcal{D}(\theta_i)$ observation distribution given $\theta_i$
$\xi$ EB hyperparameter / canonical-piece reduced parameter vector
$g(\cdot)$, $g^{-1}(\cdot)$ link and inverse-link (response) function of a slot
$G(\theta)$ Riemannian metric tensor used by the geometry engine
$\phi$ temporal persistence (AR) parameter; also hypernetwork weights in Path 3
$\pi_i$ structural-zero probability for individual $i$ (zero-inflation / hurdle)

Contents

This wiki is paginated because GitHub renders at most ~512 KB per page. Two reading paths share the same conceptual chapters; only the function reference differs.

Core chapters

Function reference — Main (recommended)

The public API only: the 66 exported functions and 65 S3 methods, no internal helpers.

Function reference — Complete (exhaustive)

Every documented function including all non-exported internal helpers and closures (460 functions).

Stan templates

Data, benchmarks & references

Clone this wiki locally