Package: gdpar 0.1.0

José Mauricio Gómez Julián

gdpar: General Dynamic Parameter Models via Reference Anchoring

Implements a unified predictive framework in which individual parameters are decomposed as theta_i equal to theta_ref plus Delta(x_i, theta_ref), with theta_ref a population reference and Delta an explicit deviation function. The decomposition follows the Additive-Multiplicative-Modulated canonical form and is estimated through three complementary paths: hierarchical Bayesian inference via 'Stan', varying-coefficient models via penalized splines, and amortized inference via hypernetworks in 'torch'. The package provides identifiability diagnostics, validity tests for the population reference, and benchmarks against canonical zero-inflated count datasets and avian abundance data from the eBird Status and Trends project. The framework and its estimation paths are described in Gomez Julian (2026) <doi:10.5281/zenodo.21046269>.

Authors:José Mauricio Gómez Julián [aut, cre]

gdpar_0.1.0.tar.gz
gdpar_0.1.0.tar.gz(r-4.7-any)gdpar_0.1.0.tar.gz(r-4.6-any)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
gdpar/json (API)

# Install 'gdpar' in R:
install.packages('gdpar', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/isadorenabi/gdpar/issues

On CRAN:

Conda:

4.40 score 20 scripts 66 exports 20 dependencies

Last updated from:2be5392367. Checks:2 ERROR, 1 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64ERROR289
source / vignettesOK327
linux-release-x86_64ERROR340
wasm-releaseFAIL3604

Exports:amm_buildamm_load_specamm_save_specamm_set_aamm_set_a_uniformamm_set_bamm_set_b_uniformamm_set_Wamm_set_x_varsamm_specas_amm_specas_per_kdiagnosticsdimwisegdpargdpar_adapter_econmlgdpar_adapter_grfgdpar_bfgdpar_bvm_checkgdpar_causal_bridgegdpar_check_identifiabilitygdpar_compare_eb_fbgdpar_compare_meta_learnersgdpar_contraction_diagnosticgdpar_dependence_diagnosticgdpar_dependence_robustgdpar_dharma_objectgdpar_ebgdpar_familygdpar_family_customgdpar_family_custom_Kgdpar_family_multigdpar_formula_setgdpar_geom_bridgegdpar_geom_fisher_simulatorgdpar_geom_fitgdpar_geom_hmcgdpar_geom_laplacegdpar_geom_metric_euclideangdpar_geom_metric_gp_fishergdpar_geom_metric_relativisticgdpar_geom_metric_riemanniangdpar_geom_metric_subriemanniangdpar_geom_orchestrategdpar_geom_orchestrate_budgetgdpar_geom_orchestrate_criteriagdpar_geom_reservoirgdpar_geom_rmhmc_adaptivegdpar_geom_targetgdpar_geometry_diagnosticgdpar_geometry_suitegdpar_geometry_thresholdsgdpar_golden_comparegdpar_ksd_jointgdpar_loogdpar_meta_learner_adaptergdpar_posterior_predictgdpar_priorgdpar_snapshot_fitgdpar_spatial_dependence_diagnosticgdpar_spatial_dependence_robustis_gdpar_meta_learner_adapteroverridepreflight_global_decisionpreflight_per_dimW_basis

Dependencies:abindbackportscheckmateclidistributionalgenericsgluelifecyclemagrittrmatrixStatsnumDerivpillarpkgconfigposteriorrlangtensorAtibbleutf8vctrswithr

Theoretical Addendum -- Block 8 (Sub-phases 8.3.1--8.3.10):
1. Purpose and Relation to the v08 Family* | 2. Setting and Notation | 2.1. AMM with $K \geq 1$ Distributional Slots | 2.2. Slot Conventions | 3. Sub-phase 8.3.1 -- param_specs as the Per-Slot Resolution Layer | 4. Sub-phase 8.3.2 -- The (D-ID) Per-Slot Identifiability Check (4C) | 5. Sub-phase 8.3.4 -- Custom Families and lognormal_loc_scale | 6. Sub-phase 8.3.5a -- Student-$t$ ($K = 3$, stan_id = 8) | 7. Sub-phase 8.3.5b -- Tweedie ($K = 3$, stan_id = 9) | 7.1. Hybrid lpdf: Dunn-Smyth series + saddlepoint | 7.2. THETA_REF_PRIOR_BLOCK per-family expansion | 7.3. Initial-value helper | 8. Sub-phase 8.3.6 -- Mixtures and Hurdle Models | 8.1. Algebraic decompositions | 8.2. Structural decisions | 8.3. Deferred cases | 9. Sub-phase 8.3.7 -- Heterogeneous Families per Slot | 10. Sub-phase 8.3.8 -- B-spline W Basis (D-D3) | 10.1. Cox-de Boor recurrence (D2 detailed) | 10.2. Boundary knot semantics | 11. Sub-phase 8.3.9 -- Residuals G1 / G2 / G3 + S3 Methods Re-validation + Route B predict.gdpar_fit for $K > 1$ | 11.1. (G1) Pearson-type residual per slot | 11.2. (G2) Randomized quantile residual (Dunn-Smyth) per slot | 11.3. (G3) DHARMa-compatible scaled residual per slot | 11.4. S3 method re-validation under $K > 1$ | 11.5. Bootstrapped goldens and the 16-column manifest | 12. Sub-phase 8.3.10 -- Release-Gate for Session 8.3 | 12.1. Fuzz testing protocol | 12.2. Debts recorded at release-gate | 13. Synthesis: The Per-Slot Architecture as a Coherent Design | 14. Implementation Status (Release-Gate Context) | 15. References (selective)

Last update: 2026-07-15
Started: 2026-07-15

Arbitrary p: Operational Cookbook for Multivariate Fits
1. What this vignette covers | 2. Building a multivariate spec | 2.1. Direct construction with dimwise() | 2.2. Per-dimension overrides with override() | 2.3. Chainable construction with amm_build() | 2.4. Canonical serialisation: amm_save_spec() and amm_load_spec() | 3. Multivariate families: gdpar_family_multi() | 3.1. Construction | 3.2. Auto-promotion | 3.3. Constraints | 4. The modulating component for p > 1 | 4.1. Materialisation at a given p | 4.2. Splitting a separable basis with as_per_k() | 4.3. Why W stays top-level | 5. Calling gdpar() for p > 1 | 5.1. Outcome layout | 5.2. Parametrization aggregation | 5.3. Full call signature for the multivariate path | 6. Inspecting the pre-flight report | 7. Extracting predictions and coefficients | 7.1. predict() returns a 3-D array | 7.2. coef() returns a unified gdpar_coef object | 7.3. as.data.frame() for tidy pipelines | 8. End-to-end worked example | 9. Reporting parametrization decisions across scenarios | 9.1. Reading the CSV directly | 9.2. Hit-rate aggregation | 9.3. Faceted plot | 10. PSIS-LOO via gdpar_loo() | 10.1. Default aggregation: per-subject | 10.2. Diagnostic aggregation: per-cell | 10.3. Pareto-$k$ caveats | 10.4. Experimental status | 11. Known limitations | 11.1. Separable W only | 11.2. Per-coordinate heterogeneous families are a future block (per-slot heterogeneity is implemented as of 8.3.7) | 11.3. Single global sigma_W shared across blocks | 11.4. Multi-parametric extension is a future block | 11.5. Pre-flight wall-time | 12. References and cross-references

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 4:
1. Purpose | 2. Setting and Notation | 2.1. The Hierarchical Bayesian Path 1 Model | 2.1.1. Two design regimes: random and conditional | 2.1.2. Generative assumption on the data | 2.2. Distance on the Parameter Space | 2.3. Notation Summary | 3. Three Asymptotic Layers | 4. Standing Asymptotic Hypotheses | 5. Theorem 4A: Posterior Consistency | 6. Theorem 4B: Posterior Contraction Rate | 6.1. Specialization to AMM Levels | 6.2. Numerical Verification of Contraction | 7. Theorem 4C: Bernstein-von Mises | 7.1. Semiparametric Bernstein-von Mises (Partial Result) | 8. Specialization to AMM Special Cases (Block 3) | 9. Open Questions | 10. Implementation Implications for Path 1 (Stan / cmdstanr) | 10.1. Prior Specification and (PRIOR-KL), (PRIOR-THICK) | 10.2. Convergence Diagnostics and (TEST), (SIEVE) | 10.3. Bernstein-von Mises Calibration Check | 10.4. (REG-EST) of Block 2 Specialized to Path 1 | 11. Summary | 12. Connections to Subsequent Blocks | Appendix A. Asymptotic Notation | Appendix B. Asymptotic Hypothesis Table | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 5:
1. Purpose | 2. Setting and Notation | 2.1. The Path 2 Model | 2.1.1. Two design regimes (parallel to Block 4) | 2.2. Vector vs. Scalar Convention for $\beta(\cdot)$ | 2.3. Distance on the Parameter Space | 2.3. Notation Summary | 3. Three Asymptotic Layers | 4. Standing Asymptotic Hypotheses for Path 2 | 5. Theorem 5A: Pointwise Consistency | 6. Theorem 5B: Uniform Consistency and Rate | 7. Theorem 5C: Pointwise Asymptotic Normality | 7.1. Scope of (L3): Explicit and Tight | 8. Proposition 5D: Adaptive Smoothing under Data-Driven $\widehat{\lambda}$ | 9. Specialization to Block 3 Special Cases | 10. Open Questions | 11. Implementation Implications for Path 2 (mgcv) | 11.1. Smoothing Parameter Selection | 11.2. Confidence Interval Reporting | 11.3. (REG-EST) of Block 2 Specialized to Path 2 | 12. Summary | 13. Connections to Subsequent Blocks | Appendix A. Asymptotic Notation for Path 2 | Appendix B. Asymptotic Hypothesis Table for Path 2 | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 6:
1. Purpose | 2. Setting and Notation | 2.1. The Path 3 Model | 2.1.1. Two design regimes (parallel to Blocks 4-5) | 2.2. Regimes of Asymptotic Analysis | 2.3. Distance and Notation | 3. Three Asymptotic Layers and Their Status for Path 3 | 4. Standing Asymptotic Hypotheses for Path 3 | 5. Theorem 6A: Consistency under the NTK Regime (Partial) | 6. Theorem 6B: PAC-Bayes Generalization Bound (Non-Asymptotic) | 7. Proposition 6C: Infinite-Width Gaussian Process Limit (Characterization of the Prior) | 8. Proposition 6D: Function-Level Consistency under Fixed Architecture (Partial) | 9. Specialization to Block 3 Special Cases | 10. Open Questions | 11. Implementation Implications for Path 3 (torch) | 11.1. Prior Specification (Bayesian Variant) | 11.2. PAC-Bayes Bound Reporting (Theorem 6B) | 11.3. NTK Diagnostic | 11.4. Discrimination Protocol Cross-Reference | 11.5. (REG-EST) of Block 2 Specialized to Path 3 | 12. Summary | 13. Connections to Subsequent Blocks | Appendix A. Asymptotic Notation for Path 3 | Appendix B. Asymptotic Hypothesis Table for Path 3 | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 9:
1. Purpose | 2. The Cognitive Starting Point: Driver Prediction Formalized | 3. Hierarchical Bayesian Cognition (Tenenbaum, Kemp, Griffiths, Goodman 2011) | 4. Core Knowledge as Structured Prior (Spelke and Kinzler 2007) | 5. The "Machines That Learn and Think Like People" Program (Lake, Ullman, Tenenbaum, Gershman 2017) | 6. Probabilistic Program Induction and One-Shot Generalization (Lake, Salakhutdinov, Tenenbaum 2015) | 7. Resource-Rationality (Lieder and Griffiths 2020) | 8. Mapping Cognitive-Science Strands to AMM Features | 9. What the Cognitive Analogy Does and Does Not Justify | 10. Open Questions on Cognitive Grounding | 11. Connections to the Rest of the Addendum | 12. Summary | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Comparing the AMM-side T-learner against External Meta-learners
1. What this vignette covers | 2. Setup | 3. The grf adapter in three lines | 4. The EconML adapter | 4.1. One-time installation | 4.2. Running the EconML adapter | 4.3. Caveat: serialization of the EconML state | 5. Reading the output | 6. Writing your own adapter (DoubleML as an example) | 7. Troubleshooting (Python-side) | 8. Where to go next

Last update: 2026-07-15
Started: 2026-07-15

Dependence-Robust Inference in gdpar (Axis 2)
1. What this vignette covers | 2. The temporal pair (recap) | 3. The spatial pair | 3.1. Diagnostic: Moran's I | 3.2. Robust SE: spatial block bootstrap | 3.3. The default block size, and why n^(1/4) | 3.4. Data-driven block size (block_size = "auto") | 4. The full-Bayes path | 5. Reading the result, and the caveats | References

Last update: 2026-07-15
Started: 2026-07-15

Distributional Regression K > 1 and Residual Diagnostics with DHARMa
1. What this vignette covers | 2. The K > 1 API | 2.1. Three equivalent input forms | 2.2. Choosing K | 2.3. End-to-end example: Gaussian K = 2 | 2.4. Custom K > 1 families via gdpar_family_custom_K() | 2.5. Prediction | 3. Residual diagnostics: G1 / G2 / G3 | 3.1. API | 3.2. Posterior predictive draws and PPC | 4. DHARMa integration (optional) | 4.1. API | 4.2. When to use DHARMa vs the built-in G2 | 5. Worked example: zero-inflated negative binomial (K = 3) | 6. Custom family registry: gdpar_family_custom() (K = 1) | 7. Known limitations and future work | References

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 7 (Multivariate Extension):
1. Purpose and Relation to v07 | 1.1. Epistemic Posture and the Critical Audit of v07 §5 | 1.2. Reading Order | 2. Notation (Multivariate Extension) | 2.1. Multivariate Population Reference and Heterogeneous Slots | 2.2. Marginal Likelihood in $\mathbb{R}^p$ and per-Slot Tensor under $K > 1$ | 2.3. Sensitivity Jacobian of the Conditional Posterior | 2.4. Total Variation, Weak Metric, and Posterior Distance | 2.5. Notation Summary | 3. Standing Hypotheses (Multivariate Extension) | 3.1. (EB-MARG-ID)$_p$ -- Multivariate Marginal Identifiability | 3.2. (PRIOR-FB-WEAK)$_p$ -- Weak FB Prior in $\mathbb{R}^p$ | 3.3. (HIER-COMPLEX)$_p$ -- Multivariate Hierarchical Regularity | 3.4. Discussion: Why the Asterisked Hypotheses are Strictly Stronger | 4. Theorem 7A* -- First-Order Asymptotic Equivalence (Multivariate) | 4.1. Proof Sketch (Extension of v07's Reference Argument) | 4.2. Why Total Variation is Restricted to Regime A (Multivariate Refinement) | 4.3. Practical Implication of Theorem 7A* | 4.4. Reduction to v07's Theorem 7A under $(p, K) = (1, 1)$ | 4.5. Audit Trail: v07 §5 Reviewed Line by Line | 5. Proposition 7B* -- Higher-Order Coverage Discrepancy (Matrix Form) | 5.1. Derivation Sketch | 5.2. Reduction to v07's Scalar Proposition 7B under $p = \dim(\xi) = 1$ | 5.3. Effective Sensitivity Diagonalization (Practical Form) | 5.4. Operational Note and the eb_correction Argument | 6. Theorem 7C* -- Compound Decision Bound (Multi-Slot $K > 1$) | 6.1. Reduction to v07's Theorem 7C under $K = 1$ | 6.2. Two Regimes of Practical Use (Multi-Slot Refinement) | 6.3. Caveat (Squared-Error Loss; Coverage Picture Unchanged) | 6.4. Reference | 7. Proposition 7D* -- Substantial Discrepancy Conditions (Multivariate) | 7.1. Reduction to v07's Proposition 7D under $(p, K) = (1, 1)$ | 8. Recommendation by Scenario (Multivariate Extension) | 9. Open Questions | 9.1. (O1*-EBFB) Adaptive Choice between EB and FB Based on Data (Multivariate) | 9.2. (O2*-EBFB) Higher-Order Coverage Correction for Multivariate EB | 9.3. (O3*-EBFB) Behavior under Model Misspecification (Multivariate) | 9.4. (O4*-EBFB) Computational Competitiveness of FB at Moderate $n$ under $K \cdot p$ Large | 9.5. (O5*-EBFB) Numerical Anti-Fragility of Multivariate Laplace under Non-Conjugacy (New) | 10. Connections to Subsequent Blocks | 11. Joint Kernel Stein Discrepancy: the gdpar_ksd_joint() Helper | 11.1. The Stein Operator and the Stein Kernel | 11.2. Empirical Gaussian Target (B9.4 iteration) and Future Extension | 11.3. Base Kernel and Bandwidth | 11.4. ESS-Weighted Variant | 11.5. Operational Reading: gdpar_compare_eb_fb and gdpar_ksd_joint are Complementary | 12. Summary | Appendix A. Notation Correspondence: Multivariate vs.\ Scalar | Appendix B. Hypothesis Table (Multivariate) | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 7:
1. Purpose | 2. Setting and Notation | 2.1. Formal Specification of EB and FB | 2.2. Distance Between EB and FB Posteriors | 2.3. Notation Summary | 3. Three Layers of EB-vs-FB Comparison | 4. Standing Hypotheses for EB-vs-FB Comparison | 5. Theorem 7A: First-Order Asymptotic Equivalence of EB and FB | 6. Proposition 7B: Higher-Order Coverage Discrepancy of EB | 7. Theorem 7C: Finite-Sample Compound Decision Bound | 8. Proposition 7D: Conditions under which EB and FB Differ Substantially | 9. When to Use EB vs FB: Recommendation by Scenario | 10. Open Questions | 11. Implementation Implications for Path 1 | 11.1. Path 1: Stan Configuration | 11.2. Path 2: Penalty Parameter Selection (EB-like on a Different Object) | 11.3. Path 3: Variational Inference vs. Posterior Sampling | 11.4. (REG-EST) of Block 2 under EB and FB | 12. Summary | 13. Connections to Subsequent Blocks | Appendix A. EB-vs-FB Notation | Appendix B. EB-vs-FB Hypothesis Table | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Geometric Robustness of Sampling (Block RG)
Why this block exists | The conceptual bridge (geometry of the user's document ↔ sampling) | An organic critical reading of the source documents | The taxonomy: pathologies as a hierarchy of geometries | The diagnostic (RG.1): size-invariant signals | The engine and the ladder (RG.2--RG.4) | Level 0 -- Euclidean diagonal (the default) | Level 1 -- Euclidean dense | Level 3 -- Riemannian (Fisher / SoftAbs, and the learned GP-Fisher) | Level 4 -- Finsler / relativistic (heavy tails) | Level 5 -- sub-Riemannian (the count; "the glory") | The orchestrator (RG.5): diagnose → select → sample → re-diagnose → escalate or certify | Option A: the flat direction (RG.6 part i, D96) | Integration: the bridge and the one-call fit (RG.6 part ii) | RG.7: applying the capability to the real count, and the certified limit | The automated fallback (gdpar_geom_laplace(), laplace_fallback) | Honesty: demonstrated vs. conjectured, and no overreach | Reproducing the heavy runs

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 2:
1. Purpose | 2. Gnoseological vs. Ontological Status of the Reference | 3. Three Structural Conditions | 3.1. (HOM) No Latent Stratification at the Parameter Level | 3.2. (REG) Regime Stability | 3.3. (CLOS) Operational Closure of the Regime | 4. Three Layers of Gnoseological Validity | 5. Proposition 2A: Algebraic-Functional Status of the Reference | 6. Lemma 2B: Statistical Consistency of the Empirical Reference Estimator | 7. Proposition 2C: Diagnostic Battery for the Three Conditions | 7.1. Test for (HOM): Latent Mixture in the Posterior of $\theta_i$ | 7.2. Test for (REG): Change-Point Detection on Fitted References | 7.3. Test for (CLOS): Extreme-Deviation Profile Inspection | 7.4. Joint Verdict | 8. When Conditions Fail: Operational Consequences | 9. Implementation Implications | 9.1. Path 1 (Hierarchical Bayesian via Stan) | 9.2. Path 2 (Varying-Coefficient via mgcv) | 9.3. Path 3 (Hypernetwork via torch) | 10. Summary | 11. Connections to Subsequent Blocks | Appendix A. Notation | Appendix B. Acronyms and Hypotheses | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Intermediate AMM Specifications: B-spline W Bases and Heterogeneous Families per Slot
1. What this vignette covers | 2. B-spline W bases | 2.1. When to switch from polynomial to B-spline | 2.2. API | 2.3. End-to-end example | 2.4. Diagnostics and known limitations | 3. Heterogeneous families per slot (K > 1) | 3.1. The default homogeneous case | 3.2. When to declare heterogeneous families | 3.3. API | 3.4. End-to-end example | 3.5. Identifiability and information diagnostics | 4. Combining B-spline W with heterogeneous families | 5. Known limitations and future work | References

Last update: 2026-07-15
Started: 2026-07-15

Parametrization Toggle: Operational Guide
1. What this vignette covers | 2. API | 2.1. Global flag | 2.2. Per-component overrides | 2.3. When to use which mode | 2.4. Anchor configuration | 3. The "auto" decision: three filters | 3.1. Filter 4 — Divergence attribution | 3.2. Filter 5 — E-BFMI | 3.3. Filter 6 — Info ratio (Path B') | 3.3.1. Effective coefficients and reference scale | 3.3.2. Log info ratio and block bootstrap | 3.3.3. Z-tests and thresholds | 4. Introspecting the decision | 5. Worked example | 6. Known limitations | 6.1. Confounding between a and W when covariates overlap | 6.2. Identifiability of individual basis components of W | 6.3. Block bootstrap versus naive bootstrap | 6.4. Pre-flight wall-time cost | 7. Summary recommendations | References

Last update: 2026-07-15
Started: 2026-07-15

Per-group hierarchical anchors: Operational Guide
1. What this vignette covers | 2. API | 2.1. The group argument | 2.2. What changes inside the model | 3. Pre-flight condition (C7) | 4. Coefficient summary under grouping | 5. Cross-group prediction | 6. Interaction with the parametrization toggle | 7. Reproducibility checklist | 8. See also

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 8:
1. Purpose | 2. Setting and Notation | 2.1. AMM and CATE/ITE: Formal Specifications | 2.2. The Object-Level Distinction | 2.3. Notation Summary | 3. Three Layers of Positioning | 4. Proposition 8A: The Conceptual Map | 5. Theorem 8B: The AMM-to-CATE Bridge as an Explicit Reparametrization | 6. Proposition 8C: Conceptual Placement of CATE Meta-Learners within AMM | 7. Proposition 8D: Decision-Theoretic Position and the "Fundamental Problem" | 8. Recommendation by Scenario | 9. Open Questions | 10. Implementation Implications | 10.1. Bridge invocation | 10.2. Reporting | 10.3. Comparison with meta-learner libraries | 11. Summary | 12. Connections to Subsequent Blocks | Appendix A. CATE/ITE Notation | Appendix B. CATE/ITE Hypothesis Table | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Predictive Models with Dynamic Individual Parameters:
1. Motivation: From Cognition to Statistics | 1.1. An Empirical Observation | 1.2. The Cognitive Structure of the Process | 1.3. What Distinguishes This Process from a Standard Model | 2. General Mathematical Formulation | 2.1. Fundamental Equation | 2.2. Individual Prediction | 2.3. Components of the Framework | 3. Path 1: Hierarchical Bayesian Model with Covariate-Dependent Random Effects | 3.1. General Description | 3.2. Hierarchical Specification | 3.2.1. Population Level | 3.2.2. Individual Level | 3.2.3. Observation Level | 3.3. Extension for Zero Inflation | 3.3.1. Structural vs. Sampling Zeros | 3.3.2. Mixture Model with Individual Deviation | 3.4. Extension for Dependence Among Observations | 3.5. Multivariate Extension | 3.6. Recommended Implementation | 4. Path 2: Varying-Coefficient Models | 4.1. General Description | 4.2. Formulation | 4.3. Relation to the Population Reference | 4.4. Estimation of $\beta(\cdot)$ | 4.5. Strengths | 4.6. Limitations | 4.7. Extension for Zero Inflation | 4.8. Extension for Dependence | 5. Path 3: Conditional Parameter Networks (Hypernetworks / Amortized Inference) | 5.1. General Description | 5.2. Formulation | 5.3. Mechanism of Anchoring to the Population Reference | 5.4. Learning Process | 5.5. Extension for Zero Inflation | 5.6. Extension for Dependence | 5.7. Multivariate Extension | 5.8. Strengths | 5.9. Limitations | 5.10. Recommended Implementation | 6. Comparative Table of the Three Paths | 7. Selection Guide by Scenario | 8. Formal Summary | 8.1. Central Principle | 8.2. Canonical Equation | 8.3. Desirable Properties | 8.4. Universality across Data Conditions | Appendix: Notation

Last update: 2026-07-15
Started: 2026-07-15

Quickstart: A First Fit in Five Minutes
1. Who this vignette is for | 2. Installation | 3. A synthetic dataset | 4. A first fit | 5. Reading the print | 6. Coefficients | 7. Predictions | 8. Diagnostics | 9. What to read next | 10. Summary

Last update: 2026-07-15
Started: 2026-07-15

Regression Testing of MCMC Outputs (Experimental)
1. What this vignette covers | 2. The four-layer snapshot schema | 2.1. Layer A — Structural (class signatures, shapes) | 2.2. Layer B — Discrete (bit-exact integer diagnostics) | 2.3. Layer C — Continuous (Monte Carlo standard error tolerance) | 2.4. Layer D — Sanity (absolute floors) | 2.5. The parametrization_resolved audit field | 3. End-to-end workflow | 3.1. Step 1 — Snapshot a reference fit | 3.2. Step 2 — Persist the snapshot | 3.3. Step 3 — Compare a fresh fit against the golden | 4. Tuning k_sigma and sanity_floor | 4.1. k_sigma: sensitivity of layer C | 4.2. sanity_floor: domain-specific absolute thresholds | 4.3. Combining k_sigma and sanity_floor | 5. Integration with testthat | 6. Workflow recommendations | 7. Known limitations | 7.1. Experimental status | 7.2. Stan implementation drift | 7.3. RNG seed semantics across hardware | 7.4. Layer C operates on posterior means only | 7.5. The structural layer is not exhaustive | 8. References and cross-references

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 3:
1. Purpose | 2. Setting and Notation | 2.1. Reminder of (D-ID) and its concrete verification | 3. Theorem 3.1: Standard Linear Regression | 4. Theorem 3.2: Hierarchical Linear Model with Covariates in Random Effects | 4.1. Per-group anchor as random intercept (Block 6.5) | 5. Theorem 3.3: Random-Coefficient Model | 6. Theorem 3.4: Hastie-Tibshirani Varying-Coefficient Model | 7. Theorem 3.5: Reference-Modulated Varying-Coefficient Model | 8. Theorem 3.6: Hierarchical Bayesian with Multiplicative Interaction | 9. Proposition 3.7: Hypernetwork Models | 10. Summary of Subsumption Map | 11. Connections to Subsequent Blocks | Appendix A. Verification Checklist Template | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 1:
1. Purpose | 2. Setting and Notation | 3. The AMM Hierarchy: Stratifying the Space of Deviation Forms | 3.1. Level 0 -- Degenerate | 3.2. Level 1 -- Linear Additive | 3.3. Level 2 -- Canonical AMM | 3.4. Level 2.5 -- Full-Matrix Multiplicative | 3.5. Level 3 -- Quadratic Extensions | 3.6. Level $K$ -- Polynomial Closure | 3.7. Level $\infty$ -- Universal AMM | 3.8. Approximation Scheme: From Polynomial AMM to Continuous Functions | 4. Why Level 2 Is the Canonical Default | 5. Standing Assumptions | 6. Identifiability of Canonical AMM | 6.1. Three Layers of Identifiability | 6.2. The Functional Independence Condition | 6.3. Theorem 1A: Algebraic-Functional Identifiability | 6.3.1. Proof of Theorem 1A | Step 1: Marginal expectation identifies $\theta_*$. | Step 2: Subtract the common reference and form differences. | Step 3: Abstract FIC at $\theta_*$ forces each difference to zero. | 6.3.2. Necessity of FIC | 6.4. Lemma 1B: Statistical Bridge | 6.5. Corollary 1: Centering of the Framework | 6.6. Proposition 1C: Numerical Verifiability via the Gram Matrix | 6.6.1. Condition C4-bis: Cross-Coordinate Identifiability for p > 1 | 6.6.1.1. The failure mode | 6.6.1.2. The condition | 6.6.1.3. Why the extended Gram matrix cannot detect C4-bis | 6.6.1.4. The implementation: rigor = "full" vs rigor = "fast" | 6.6.1.5. Pedagogical example: overlap that fails (rigor = "full") | 6.6.1.6. Pedagogical example: coord-wise disjoint that passes | 6.6.1.7. Worked design pattern: when overlap is unavoidable | 6.6.1.8. Summary | 6.6.2. Condition C7: Anti-aliasing under per-group anchors (Block 6.5) | 6.6.2.1. The failure mode | 6.6.2.2. The condition | 6.6.2.3. Implementation | 6.6.2.4. Pedagogical example: factor(group) in a fails (C7) | 6.6.2.5. Worked design pattern: when a column is constant per group | 6.6.2.6. Summary | 6.7. Theorem 1E: Identifiability of $W$ on the Prior Support | 6.8. Proposition 1F: Scope and Limits of Identifiability for the Hypernetwork (Path 3) | 6.8.1. Empirical Protocol for Discriminating between Richer Structure and Non-Identifiability | 6.8.2. Decision Rule | 7. Identifiability of Higher Levels of the Hierarchy | 8. Standard Models as Special Cases | 8.1. Standard Regression | 8.2. Random-Coefficient Model | 8.3. Varying-Coefficient Model (Hastie and Tibshirani 1993) | 8.4. Hierarchical Bayesian with Multiplicative Interaction | 8.5. Full Canonical AMM | 8.6. Hypernetwork | 9. Test for Component Selection | 9.1. Bayesian Selection via Stratified PSIS-LOO | 9.2. Frequentist Selection via Generalized LRT | 9.3. Hypernetwork Component Norms | 9.4. Reported Selection Output | 10. Implementation Implications | 10.1. Path 1: Hierarchical Bayesian via Stan | 10.2. Path 2: Varying-Coefficient via mgcv | 10.3. Path 3: Amortized Inference via torch | 11. Summary of the Block | 12. Connections to Subsequent Blocks | Appendix A. AMM Notation | Appendix B. Acronyms and Hypotheses | References Cited in This Block

Last update: 2026-07-15
Started: 2026-07-15

The Empirical-Bayes Workflow in gdpar
1. What this vignette covers | 2. Setup | 3. Minimal gdpar_eb() call (K = 1 + p = 1) | 4. Path A (K = 1, p > 1): multivariate outcome | 5. Path B (K > 1, p = 1): multi-parametric family | 6. Path C (K > 1, p > 1): full K x p extension | 7. Numerical diagnostics: how to read them | 8. EB vs FB comparison via gdpar_compare_eb_fb() | 9. Troubleshooting | 9.1. gdpar_eb_numerical_error: kappa = ... | 9.2. gdpar_unsupported_feature_error on Path C | 9.3. Multi-start dispersion warning | 9.4. Path B conditional HMC instability under logit-strict links | 9.5. Path C smoke validation | 10. Where to go next | References

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 8.5.A:
1. Purpose and position in the package | 2. Notation inherited from v08 (rapid reference) | 3. Definition: the T-learner AMM-side | 4. Identification assumptions | 4.1. Inherited from v08 | 4.2. Residual no-confounding (T-learner-specific) | 4.3. What the bridge does not assume | 5. Estimation | 6. Inference: per-observation credible bounds and the ATE | 7. Identifiability per arm | 8. Minimum reproducible example | 9. Limitations of the T-learner | 10. Open questions (O-CATE)* | Appendix A. Notational correspondence with Kuenzel et al. (2019) | Appendix B. Implementation notes for future external comparators (8.5.B preview) | References cited in this addendum

Last update: 2026-07-15
Started: 2026-07-15

Theoretical Addendum -- Block 8.5.B:
1. Purpose and position in the package | 2. Notation inherited from v08 and v08b (rapid reference) | 3. The pluggable adapter contract | 4. Identification under cross-method comparison | 5. Concordance criterion | 6. Identifiability per arm under the bridge | 7. Limits of the comparison | 8. Minimum reproducible example (CRAN-valid, R-only) | 9. Open questions (O*-CMP) | Appendix A. Notational correspondence with the meta-learner literature | Appendix B. Implementation notes for additional adapters | References cited in this addendum

Last update: 2026-07-15
Started: 2026-07-15

Readme and manuals

Help Manual

Help pageTopics
Subset a gdpar_formula_set by slot name or position[.gdpar_formula_set
Extract a single formula from a gdpar_formula_set[[.gdpar_formula_set
Start a chainable builder for an AMM specificationamm_build
Load a canonical amm_spec file produced by amm_save_specamm_load_spec
Serialize an amm_spec to a canonical plain-text fileamm_save_spec
Set a per-dimension additive basis override on an AMM builderamm_set_a
Set the uniform additive basis on an AMM builderamm_set_a_uniform
Set a per-dimension multiplicative basis override on an AMM builderamm_set_b
Set the uniform multiplicative basis on an AMM builderamm_set_b_uniform
Set the modulating basis on an AMM builderamm_set_W
Set the covariate names used by the modulating component on an AMM builderamm_set_x_vars
Specify the AMM canonical decompositionamm_spec
Finalise an AMM builder into an amm_specas_amm_spec
Split a separable multivariate W_basis into per-coordinate sub-basesas_per_k
Coerce a gdpar_coef object to a long-tidy data.frameas.data.frame.gdpar_coef
as.data.frame method for gdpar_preflight_reportas.data.frame.gdpar_preflight_report
Coefficient extraction for gdpar_eb_fitcoef.gdpar_eb_fit
Coefficients of a fitted gdpar modelcoef.gdpar_fit
Extract diagnostics from a fitted gdpar modeldiagnostics
Broadcast a uniform per-component specification to multiple dimensionsdimwise
One-line formatter for gdpar_coef objectsformat.gdpar_coef
Format method for gdpar_preflight_reportformat.gdpar_preflight_report
Fit an AMM canonical modelgdpar
Reference adapter: EconML CausalForestDML for gdpar_compare_meta_learnersgdpar_adapter_econml
Reference adapter: grf::causal_forest for gdpar_compare_meta_learnersgdpar_adapter_grf
Construct a formula set with brms-style sugargdpar_bf
Bernstein-von Mises calibration check (opt-in, costly)gdpar_bvm_check
Causal bridge (T-learner) between two gdpar fitsgdpar_causal_bridge
Check basis-restricted functional independence via Gram matrixgdpar_check_identifiability
Compare an Empirical-Bayes fit against a Fully-Bayes fitgdpar_compare_eb_fb
Compare the AMM-side T-learner against external meta-learnersgdpar_compare_meta_learners
Empirical posterior contraction rate diagnostic (opt-in, costly)gdpar_contraction_diagnostic
Residual dependence diagnostic for a scalar Empirical-Bayes fitgdpar_dependence_diagnostic
Dependence-robust standard errors via a temporal block bootstrapgdpar_dependence_robust
Build a DHARMa simulation object from a fitted gdpar modelgdpar_dharma_object
Fit an AMM canonical model via Empirical Bayes (EB)gdpar_eb
Construct a family object for AMM fittinggdpar_family
Construct a custom family object for AMM fittinggdpar_family_custom
Construct a K = 2 custom family from a canonical lpdf patterngdpar_family_custom_K
Construct a multivariate family for AMM fitting with p > 1gdpar_family_multi
Construct a canonical formula set for multi-parameter AMM modelinggdpar_formula_set
Bridge a fitted gdpar model to the geometry-adaptive orchestratorgdpar_geom_bridge
Simulation-based estimator of the expected Fisher informationgdpar_geom_fisher_simulator
One-call geometry-adaptive fit (K-individual path)gdpar_geom_fit
Static Hamiltonian Monte Carlo with a pluggable geometry (Block RG engine)gdpar_geom_hmc
Laplace approximation of a posterior at its modegdpar_geom_laplace
Euclidean (constant) metric for the geometric sampling enginegdpar_geom_metric_euclidean
Learned Gaussian-process Riemannian metric (expected Fisher surrogate)gdpar_geom_metric_gp_fisher
Finsler / relativistic metric for the geometric sampling enginegdpar_geom_metric_relativistic
Riemannian (position-dependent) metric for the geometric sampling enginegdpar_geom_metric_riemannian
Sub-Riemannian metric and integrator for the geometric sampling enginegdpar_geom_metric_subriemannian
Geometry-adaptive sampling orchestrator (opt-in)gdpar_geom_orchestrate
Budget and stopping rule for the geometry-adaptive orchestratorgdpar_geom_orchestrate_budget
Success criteria for the geometry-adaptive orchestratorgdpar_geom_orchestrate_criteria
Collect a reservoir of positions for the learned Gaussian-process metricgdpar_geom_reservoir
Adaptive Riemannian HMC with online novelty-driven active learninggdpar_geom_rmhmc_adaptive
Build a target for the geometric sampling enginegdpar_geom_target
Forensic diagnostic of posterior geometry (opt-in)gdpar_geometry_diagnostic
Catalogue of synthetic posterior geometries of known difficultygdpar_geometry_suite
Default classifier thresholds for the posterior-geometry diagnosticgdpar_geometry_thresholds
Compare a fit snapshot against a golden reference (experimental)gdpar_golden_compare
Joint kernel Stein discrepancy between EB and FB posteriorsgdpar_ksd_joint
Approximate leave-one-out cross-validation for a gdpar fitgdpar_loo
Adapter for external meta-learners used by gdpar_compare_meta_learnersgdpar_meta_learner_adapter
Posterior predictive draws for a fitted gdpar modelgdpar_posterior_predict
Specify the priors for the AMM hierarchical Bayesian modelgdpar_prior
Build a reproducibility snapshot of a fitted gdpar model (experimental)gdpar_snapshot_fit
Spatial residual dependence diagnostic for a scalar Empirical-Bayes fitgdpar_spatial_dependence_diagnostic
Dependence-robust standard errors via a spatial block bootstrapgdpar_spatial_dependence_robust
Test whether an object is a gdpar_meta_learner_adapteris_gdpar_meta_learner_adapter
Number of K-individual parameters in a gdpar_formula_setlength.gdpar_formula_set
Slot names of a gdpar_formula_setnames.gdpar_formula_set
Layer a per-dimension override on a dims_specoverride
Posterior predictive check for a fitted gdpar modelpp_check.gdpar_fit
Predict method for gdpar_causal_bridge objectspredict.gdpar_causal_bridge
Prediction for gdpar_eb_fitpredict.gdpar_eb_fit
Posterior draws of theta_i for a fitted gdpar modelpredict.gdpar_fit
Predict method for gdpar_meta_learner_comparison objectspredict.gdpar_meta_learner_comparison
Accessor: aggregated per-component preflight decisionspreflight_global_decision
Accessor: per-dimension preflight decisionspreflight_per_dim
Print method for amm_builder objectsprint.amm_builder
Print method for amm_spec objectsprint.amm_spec
Print method for dims_spec objectsprint.dims_spec
Print method for gdpar_bvm_report objectsprint.gdpar_bvm_report
Print method for gdpar_causal_bridge objectsprint.gdpar_causal_bridge
Print method for gdpar_coef objectsprint.gdpar_coef
Print method for gdpar_contraction_report objectsprint.gdpar_contraction_report
Print method for gdpar_dependence_diagnostic objectsprint.gdpar_dependence_diagnostic
Print method for gdpar_dependence_robust objectsprint.gdpar_dependence_robust
Print method for gdpar_diagnostics objectsprint.gdpar_diagnostics
Print method for gdpar_eb_fb_comparisonprint.gdpar_eb_fb_comparison
Print method for gdpar_eb_fitprint.gdpar_eb_fit
Print method for gdpar_family objectsprint.gdpar_family
Print method for gdpar_family_multi objectsprint.gdpar_family_multi
Print method for gdpar_fit objectsprint.gdpar_fit
Print method for gdpar_formula_set objectsprint.gdpar_formula_set
Print method for gdpar_geom_bridge objectsprint.gdpar_geom_bridge
The certified-limit object of the geometry-adaptive orchestratorgdpar_geom_certificate print.gdpar_geom_certificate
Print method for gdpar_geom_fit objectsprint.gdpar_geom_fit
Print method for gdpar_geom_hmc objectsprint.gdpar_geom_hmc
Print method for gdpar_geom_laplace objectsprint.gdpar_geom_laplace
Print method for gdpar_geom_orchestration objectsprint.gdpar_geom_orchestration
Print method for gdpar_geom_rmhmc_adaptive objectsprint.gdpar_geom_rmhmc_adaptive
Print method for gdpar_geom_target objectsprint.gdpar_geom_target
Print method for gdpar_geometry_diagnostic objectsprint.gdpar_geometry_diagnostic
Print method for gdpar_geometry_target objectsprint.gdpar_geometry_target
Print method for gdpar_identifiability_report objectsprint.gdpar_identifiability_report
Print method for gdpar_ksd_jointprint.gdpar_ksd_joint
Print method for gdpar_meta_learner_adapterprint.gdpar_meta_learner_adapter
Print method for gdpar_meta_learner_comparison objectsprint.gdpar_meta_learner_comparison
Print method for gdpar_preflight_reportprint.gdpar_preflight_report
Print method for gdpar_prior objectsprint.gdpar_prior
Print method for gdpar_spatial_dependence_diagnostic objectsprint.gdpar_spatial_dependence_diagnostic
Print method for gdpar_spatial_dependence_robust objectsprint.gdpar_spatial_dependence_robust
Print method for summary.gdpar_causal_bridge objectsprint.summary.gdpar_causal_bridge
Print method for summary.gdpar_eb_fb_comparisonprint.summary.gdpar_eb_fb_comparison
Print method for summary.gdpar_eb_fitprint.summary.gdpar_eb_fit
Print method for summary.gdpar_meta_learner_comparison objectsprint.summary.gdpar_meta_learner_comparison
Print method for W_basis objectsprint.W_basis
Residuals for a fitted gdpar modelresiduals.gdpar_fit
Summary method for gdpar_causal_bridge objectssummary.gdpar_causal_bridge
Summary method for gdpar_coef objectssummary.gdpar_coef
Summary method for gdpar_eb_fb_comparisonsummary.gdpar_eb_fb_comparison
Summary method for gdpar_eb_fitsummary.gdpar_eb_fit
Summary method for gdpar_fit objectssummary.gdpar_fit
Summary method for gdpar_ksd_jointsummary.gdpar_ksd_joint
Summary method for gdpar_meta_learner_comparison objectssummary.gdpar_meta_learner_comparison
Summary method for gdpar_preflight_reportsummary.gdpar_preflight_report
Construct a functional basis for the modulating component WW_basis