-
Notifications
You must be signed in to change notification settings - Fork 0
Part II Mathematical Foundations
← Part I — Conceptual Framework · gdpar Wiki Home · Part III — Computational Architecture →
This part develops, at reference grade, the mathematics the package implements: the AMM decomposition and its identifiability theory (§II.1), the asymptotic theory of the three paths (§II.2), the Empirical-Bayes theory and its multivariate extension (§II.3), the distributional families and links (§II.4), the B-spline W bases (§II.5), grouped references (§II.6), the causal-inference bridge (§II.7), the geometry-adaptive sampling metrics (§II.8), and the dependence-robust inference machinery (§II.9). The identifiability material corresponds to package source R/check_identifiability.R, R/preflight*.R, R/amm_spec.R; the conditions stated here are enforced in code and the cross-references make the link explicit.
There are
-
(L1) Algebraic-functional identifiability — does the latent function
$\theta_i(\cdot)$ determine the components$(\theta_{\text{ref}},a,b,W)$ ? (Theorem 1A.) -
(L2) Statistical identifiability — do the observable data
${(x_i,y_i)}$ determine them? (Lemma 1B, via a hypothesis on the response family.) - (L3) Numerical verifiability — in a chosen finite basis, can a runtime diagnostic detect identifiability or its failure? (Proposition 1C, the Gram-matrix check.)
The space of deviation forms is stratified by joint polynomial order in
| Level | Form | Joint order | Status |
|---|---|---|---|
| 0 (degenerate) | standard non-mixed regression | ||
| 1 (linear additive) |
|
classical random coefficients; no reference-dependence | |
| 2 (canonical AMM) | mixed | the canonical default | |
| 2.5 (full-matrix mult.) | — | Level 2 is |
|
| 3 (quadratic) | adds |
up to |
— |
|
|
|
||
|
|
|
— | hypernetwork; Proposition 1F |
The canonical Level-2 AMM is
with
Approximation (Scheme 1D). On compact
| Condition | Meaning | |
|---|---|---|
| (C1) | covariates centered | |
| (C2) | additive component centered | |
| (C3) | multiplicative component centered | |
| (C4) |
|
modulating matrix anchored |
| (C5) |
|
support/integrability |
| (C6) | non-degeneracy of the reference |
The joint consequence of (C1)–(C4) is the centering of the framework:
In the implementation, (C2)/(C3) are enforced empirically by column-centering the design matrices
Let
Abstract FIC at
$\theta_*$ .$\mathcal S_a,\mathcal S_b(\theta_*),\mathcal S_W$ are linearly independent in$L^2(\mu,\mathbb R^p)$ :$f_a+f_b+f_W=0\Rightarrow f_a=f_b=f_W=0$ .
The basis-restricted FIC (
Under (LIN) (
$\mathcal F_a,\mathcal F_b,\mathcal F_W$ finite-dimensional linear subspaces), (C1)–(C5), (C6) at $\theta_$, and Abstract FIC at $\theta_$, the latent function $ \theta_i^(\cdot)=\theta_+a(\cdot)+b(\cdot)\odot\theta_+W(\theta_)\cdot$ uniquely determines $(\theta_,a,b,W(\theta_))$.
The proof has three steps: (1) taking
Necessity of FIC requires, in addition to (LIN) and (C1)–(C6), the hypothesis (EVAL): point evaluation $E_{\theta_}:\mathcal F_W\to\mathbb R^{p\times d}$, $W\mapsto W(\theta_)$, is surjective. If Abstract FIC fails (and (EVAL) holds), two distinct admissible tuples produce the same latent function — explicit non-identifiability. (LIN) lets perturbations stay in the classes; (EVAL) realizes the required
Lemma 1B. Under Theorem 1A's hypotheses plus (D-ID) (the response family
${\mathcal D(\theta)}$ is identifiable in$\theta$ :$\mathcal D(\theta)=\mathcal D(\theta')\Rightarrow\theta=\theta'$ ), the joint law of$(X_i,Y_i)$ determines $(\theta_,a,b,W(\theta_))$.
(D-ID) holds for one-parameter exponential families with canonical link, full-rank multi-parameter exponential families, ZIP/ZINB under independent variation of
Fix a basis
For the chosen finite representation
$B$ , $\text{FIC}B$ at $\theta$ holds iff $\mathbf G(\theta_)$ is non-singular (Gram non-singularity$=$ column linear independence).
Caveats: it diagnoses basis-restricted FIC, not abstract FIC; tol (default gdpar_check_identifiability().
For
(C4-bis) Coord-wise structural disjointness. For every
$k$ :$\mathrm{names}(Z_{a,k})\cap\mathrm{names}(X)=\emptyset$ .
This is necessary but not sufficient (overlap enables aliasing; regularization can suppress it). The extended Gram matrix cannot detect it: at a fixed check_C4_bis_per_k()) from post-fit posterior-geometry forensics (divergences, low ESS, high gdpar_check_identifiability(..., rigor=) offers "full" (default; aborts on overlap) and "fast" (warns of class gdpar_c4bis_overlap_warning, for users who intend the overlap and regularize the gdpar_prior()). The per-$k$ breakdown (passed, lambda_min/max, condition_number, shared_cols, collinear_directions) is in report$c4_bis$per_k.
Block 6.5 promotes the reference to a per-group anchor group = ~ species; group = NULL reduces bit-exactly to the single-anchor regime). If
(C7). When
use_groups = 1,$\mathrm{rank}([G\mid Z_a])=\mathrm{ncol}(G)+\mathrm{ncol}(Z_a)$ and likewise for$Z_b$ .
Enforced pre-fit by .check_group_aliasing_c7() in two layers: (1) within-group variance per column (catches constant-per-group / factor(group) aliases), (2) joint QR rank of normalized gdpar_input_error naming the columns. Together with C1–C4 (global Gram) and C4-bis (cross-component per coord), C7 completes a three-tier pre-flight; the post-fit forensic remains the posterior geometry.
In the Bayesian setting
-
(a)
$W=W'$ $\pi_\Theta$ -a.e. on$\mathrm{supp}(\pi_\Theta)$ ; -
(b)
$W=W'$ in$L^2(\pi_\Theta;\mathbb R^{p\times d})$ (the recommended default conclusion); -
(c)
$W=W'$ in$C(\overline{\mathrm{supp}(\pi_\Theta)})$ , additionally requiring (BAY-1) support$=$ closure of a connected open$U$ , (BAY-2)$W$ continuous (subsumed by (C5)), (BAY-3)$\pi_\Theta$ charges every non-empty open subset of$U$ (so the a.e.-identification set is dense). These are automatic for absolutely continuous priors with positive density on a connected open set.
No tier identifies
For the hypernetwork,
When Path 3 diverges from Path 1 on the same data, a four-step empirical protocol discriminates "richer structure" from "undetected non-identifiability": (1) stability across
Standard models are Theorem-1A special cases verified to satisfy (LIN): standard regression (Level 0), random coefficients (Level 1, identifiability
Component selection over the eight restrictions
The package develops asymptotics for all three paths to reference grade (only Path 1 is executable). The reference text throughout is Ghosal & van der Vaart (2017); AMM-specific theorems are specializations, with explicit statements of what is established, what the AMM specialization costs in extra hypotheses, and what remains open.
The Path-1 model places priors on every component:
Two distances, no global equivalence. Hellinger
The three asymptotic layers parallel the three identifiability layers:
-
(L1) Posterior consistency —
$\Pi_n({d(\eta,\eta_*)>\varepsilon})\xrightarrow{P}0$ for every$\varepsilon$ . -
(L2) Contraction rate —
$\exists,\varepsilon_n\to0$ ,$n\varepsilon_n^2\to\infty$ , with$\Pi_n({d>M\varepsilon_n})\xrightarrow{P}0$ . -
(L3) Bernstein–von Mises —
$\Pi_n(\sqrt n(\eta-\widehat\eta_n)\in\cdot)\xrightarrow{w}\mathcal N(0,I_*^{-1})$ in total variation.
Standing asymptotic hypotheses (additional to C1–C6, LIN, D-ID, IID): (PRIOR-KL) $\pi(B_\varepsilon(\eta_))>0$ for all $\varepsilon$ (KL-ball $B_\varepsilon={K(\eta_,\eta)\le\varepsilon^2,V(\eta_,\eta)\le\varepsilon^2}$); (PRIOR-THICK) $\pi(B_{\varepsilon_n}(\eta_))\ge e^{-C_1 n\varepsilon_n^2}$; (SIEVE) sieves
Theorem 4A (posterior consistency). Under C1–C6, LIN, D-ID, the Block-2 regularity (HOM)+(REG)+(IID), (PRIOR-KL), (TEST), and finite bracketing entropy on sieves with
$\pi(\Theta_n^c)\to0$ : $\Pi_n({d_H(\eta,\eta_)>\varepsilon})\xrightarrow{P_{\eta_}}0$. (Schwartz 1965 specialized to AMM; novelty is verifying PRIOR-KL and entropy for the product prior, which under LIN reduces to prior positivity at$\eta_*$ .)
Theorem 4A discharges (REG-EST) of Block 2 in average-error form: the posterior-mean individual parameter
Theorem 4B (contraction rate). Adding (PRIOR-THICK) and (SIEVE) for
$\varepsilon_n\to0$ ,$n\varepsilon_n^2\to\infty$ :$\Pi_n({d_H>M\varepsilon_n})\xrightarrow{P}0$ (Ghosal–Ghosh–van der Vaart 2000 specialized to AMM).
Rates by Level: Level 0/1 parametric
Theorem 4C (Bernstein–von Mises). For finite-dim parametric AMM (Levels 0/1/2 with finite-dim classes), under 4A+4B, (LAN), and a consistent
$\sqrt n$ -MLE: the posterior is asymptotically$\mathcal N(\widehat\eta_n,n^{-1}I_*^{-1})$ in total variation. Consequence: Bayesian credible intervals and asymptotic frequentist CIs coincide in the limit — this justifies reporting credible intervals as the primary uncertainty.
Proposition 4C-semi (semiparametric BvM). With parametric
$\theta_{\text{ref}}$ and non-parametric$(a,b,W)$ , under Castillo–Rousseau (2015) conditions ($\sqrt n$ -recoverability + least-favorable-direction-aware prior), the marginal posterior of$\theta_{\text{ref}}$ is$\sqrt n$ -asymptotically normal at the semiparametric efficiency bound$V_*$ . Tight scope: this is only for the marginal of$\theta_{\text{ref}}$ — the function-valued$(a,b,W)$ need not be asymptotically Gaussian in a function-space metric, and the library reports their intervals as posterior quantiles (function-space credible balls), never as$\sqrt n$ Gaussian intervals.
Open questions explicitly recognized: (O1) full BvM for non-parametric components (only partial Sobolev-topology results exist); (O2) adaptive contraction rates for general AMM Path-1 priors; (O3) misspecification asymptotics under failure of (HOM)/(REG) (contraction to a KL-projection pseudo-true parameter, Kleijn–van der Vaart 2012). Implementation diagnostics: prior KL-support report, Stan
These paths are not executable in gdpar 0.1.0 but carry reference-grade asymptotics:
-
Path 2 (VCM, vignette
v05). Frequentist penalized-spline asymptotics: pointwise and uniform consistency of$\widehat\beta(\cdot)$ , asymptotic normality at the spline rate$n^{-\beta/(2\beta+1)}$ , with the reference recovered as$\beta(\bar z)$ and the deviation as$\beta(z)-\beta(\bar z)$ ; conditions specialize Fan–Zhang (2008), Stone (1985), Wood (2017). The curse of dimensionality in$z$ is the binding limitation. -
Path 3 (hypernetwork, vignette
v06). Only partial results are available for Bayesian neural networks: consistency under the Neural-Tangent-Kernel regime (Jacot et al. 2018; Bach 2017), PAC-Bayes generalization bounds (Dziugaite–Roy 2017), and an explicit acknowledgement that BvM and contraction rates are open (Hron et al. 2020). Universal approximation gives density, not identifiability; the function-level identifiability of$\Phi_\phi$ and its contraction are open (cf. Proposition 1F).
The cross-path consistency: parametric AMM gets the full
Partition
Theorem 7A (first-order equivalence). Under regularity + the three hypotheses, EB and FB lower-level posteriors agree asymptotically. Regime A (finite-dim parametric AMM):
$d_{\text{TV}}(\Pi_n^{\text{EB}},\Pi_n^{\text{FB}})\xrightarrow{P}0$ . Regime B (non-parametric AMM): TV is too strong; convergence holds for smooth bounded$L^2(\mu)$ -Lipschitz functionals (equivalently Wasserstein-1/Prokhorov on the joint posterior). Specializes Petrone–Rousseau–Scricciolo (2014) and Rousseau–Szabo (2017). Practical content: for large$n$ + weak prior, EB and FB give essentially the same posterior over$\xi$ ; the choice is then computational/methodological.
Proposition 7B (higher-order coverage). Under Edgeworth-type expansion conditions (Bickel–Ghosh 1990), EB credible intervals for a smooth functional
$g(\xi)$ under-cover by$O(n^{-1})$ : $\mathbb P(g(\xi^)\in\mathrm{CI}n^{\text{EB},\alpha})=(1-\alpha)-C{g,\alpha}n^{-1}+o(n^{-1})$, with $C_{g,\alpha}\approx(g'(\xi^))^2/I_{\theta\theta}^{\text{marg}}\cdot\kappa(\alpha)$ (larger when$g$ is sensitive to$\theta_{\text{ref}}$ , smaller when$\theta_{\text{ref}}$ is well-identified); FB covers to first order. The library applies a post-hoc inflation$\sqrt{1+C_{g,\alpha}/(n-q)}$ (argumenteb_correction=TRUE), explicitly approximate.
Theorem 7C (compound decision, Robbins–Efron). For
$K$ exchangeable units, $\frac1K\sum_k\mathbb E[(\widehat\xi_k^{\text{EB}}-\xi_k^)^2]\le\frac1K\sum_k\mathbb E[(\widehat\xi_k^{\text{FB}}-\xi_k^)^2]+B_K$ with$B_K\le\frac{C_1}{K}\mathbb E[(\widehat\theta_{\text{ref}}^{\text{EB}}-\theta_{\text{ref}}^*)^2]\to0$ : EB risk approaches FB risk as$K\to\infty$ (squared-error loss on point estimates only — coverage still under-covers per 7B).
Proposition 7D. EB and FB differ substantially when: (i) small
$I_{\theta\theta}^{\text{marg}}$ (poorly identified upper level); (ii) strongly informative$\pi_\Theta$ ; (iii) multimodal$L_n^{\text{marg}}$ ; (iv) misspecified$\pi_\xi$ (EB regularizes by tuning$\theta_{\text{ref}}$ , FB does not).
Default is FB (gdpar()); EB (gdpar_eb()) is opt-in. EB's independent methodological advantages: honest avoidance of a prior on
Multivariate / multi-slot extension (vignette v07b): Theorem 7A* (to
The four gdpar_eb() path regimes (dispatched from the resolved $(K,p)$), each with a marginal+conditional Stan template pair and its own Proposition-7B correction:
| Regime | Stan template pair | 7B correction | |
|---|---|---|---|
| Base |
amm_eb_marginal.stan + amm_eb_conditional.stan
|
scalar | |
| Path A |
amm_eb_marginal_multi.stan + ..._conditional_multi.stan
|
matricial 7B* | |
| Path B |
amm_eb_marginal_K.stan + ..._conditional_K.stan
|
per-slot scalar | |
| Path C |
amm_eb_marginal_KxP.stan + ..._conditional_KxP.stan
|
tensor |
The canonical EB recipe (three steps): (i) marginal-likelihood maximization for cmdstanr::laplace() with multi-start + Levenberg–Marquardt ridge + condition-number guard — the anti-fragility strategy); (ii) plug gdpar_compare_eb_fb() operationally verifies Theorem 7A (marginal TV) and Proposition 7B (per-cell width ratio).
Hierarchical AMM posteriors can suffer the classic centered/non-centered pathology of hierarchical models. The package treats the parametrization of the multiplicative interaction R/preflight.R, R/preflight_multi.R, R/contraction_diagnostic.R.
For the multiplicative term, write the contribution of coordinate involving the reference as
-
Centered (CP). Sample
$b_{\text{coef}}$ directly; the term$\theta_{\text{ref}}\cdot b_{\text{coef}}$ couples$b_{\text{coef}}$ to$\theta_{\text{ref}}$ multiplicatively. CP mixes well when the data are informative about the interaction (the likelihood dominates the funnel). -
Non-centered (NCP). Reparametrize
$b_{\text{coef}}=\mu_b+\tau_b,\tilde b$ with$\tilde b\sim\mathrm{Normal}(0,1)$ , decoupling the prior geometry; NCP mixes well when the data are weakly informative (prior-dominated funnel). -
Linear reparametrization. Sample the product
$c_b=\theta_{\text{ref}}\cdot b_{\text{coef}}$ directly as a linear coordinate, sidestepping the bilinear$(\theta_{\text{ref}},b)$ geometry altogether. This is the package's resolution of the deeper diagnosis (below): the root cause of the funnel is the non-linear$(\theta_{\text{ref}},b)$ parametrization, not the centering per se; sampling the linear product removes the bilinearity at the source.
The diagnosis that led here proceeded in three iterations — NCP did not cure it, CP did not cure it, and the residual pathology was traced to the bilinear coordinate; the final fix samples
The choice among CP/NCP/(linear) is made by a pre-flight procedure that runs a short pilot and computes an information ratio discriminating prior-dominated from likelihood-dominated regimes, then dispatches:
-
preflight_parametrization()(scalar) /preflight_parametrization_multi()($p>1$ , per coordinate) run the pilot sample and the attribution/info-ratio computation. - The information ratio contrasts how much of the posterior variation in the interaction is attributable to the data vs the prior; an asymptotic
$z$ /$t$-style test on it, evaluated against thresholds, picks the regime. Defaults:tau_cp = 5,tau_ncp = 2(the boundary thresholds of the ratio); a high ratio (data-informative) selects CP, a low ratio selects NCP. - The variance/score machinery is made dependence-aware: effective weights + a chain-aware block bootstrap + an asymptotic z-test give the ratio's sampling distribution without assuming independence of the pilot draws (Path B′ canonical design). The per-coordinate variant decides each coordinate of
$\theta_{\text{ref}}\in\mathbb R^p$ separately and resolves a global vs per-dimension decision. -
resolve_parametrization()/resolve_parametrization_multi()turn the diagnostic verdict into the concrete Stan-side toggle used by the code generator.preflight_global_decision()andpreflight_per_dim()are the exported user-facing entry points;decision_to_logical()maps the verdict to the boolean the template consumes.
Confounding-induced NCP preference is treated as correct, not a defect: when a covariate confounds the reference, the prior-dominated geometry genuinely calls for NCP, and the diagnostic is designed to detect exactly that. The whole apparatus is data-driven: no parametrization is hard-coded; the knob is set from a declared, reproducible statistic of a pilot fit.
gdpar_contraction_diagnostic() (R/contraction_diagnostic.R) operationalizes the empirical contraction-rate verification of Theorem 4B (§II.2.1): it refits at increasing sample sizes and tracks the posterior credible-set diameter, flagging deviations from the predicted rate
A family is represented internally as an ordered list of per-parameter specifications (gdpar_param_spec), one per slot name (link (and its inverse), a family_role ∈ {location, scale, shape, df, mixture_pi, power}, a support (real_line/positive_real/unit_interval/bounded_open), an identifiability descriptor (did_status ∈ {holds, holds_under_condition, user_responsible} with condition + reference, i.e. the (D-ID) hypothesis of Lemma 1B made per-slot), a canonical prior kind, and a scope (per_observation or population). The link factory implements exactly three links:
The built-in roster (location slot gets the user link; auxiliaries get fixed links — log for positive-real, logit for unit-interval, identity for the Tweedie power):
| Family | Slots (role, link) |
|---|---|
| gaussian |
|
| poisson |
|
| neg_binomial_2 |
|
| bernoulli |
|
| beta |
|
| gamma |
|
| student_t |
|
| tweedie |
|
| zip |
|
| zinb |
|
| hurdle_poisson |
|
| hurdle_neg_binomial_2 |
|
Each family carries an integer stan_id selecting the likelihood branch in the Stan templates (Part V). Auxiliary slots default to population scope and can be promoted to per_observation (their own AMM decomposition) by the user — that is distributional regression: gdpar_family_custom, gdpar_family_custom_K) where the user declares the likelihood and accepts responsibility for (D-ID) via did_override. The exported gdpar_family, gdpar_family_multi (the R/families.R; per-likelihood Stan math: Part V.
The modulating component W_basis(type, degree, knots, df, boundary_knots, basis_fn, dim, p) with three types:
-
polynomial (default degree 1): block-by-coordinate powers, no cross-terms,
$$\text{eval}(\theta)=\big(\theta_1,\theta_1^2,\dots,\theta_1^{\deg},\ \theta_2,\dots,\theta_2^{\deg},\ \dots,\ \theta_{p},\dots,\theta_{p}^{\deg}\big);$$ -
bspline (default degree 3): per-coordinate B-spline bases concatenated,
$\text{eval}(\theta)=(B(\theta_1),\dots,B(\theta_p))$ , with Cox–de Boor evaluation performed Stan-side for differentiability inside HMC; the R side (.gdpar_resolve_bspline_knots,.gdpar_bspline_knots_full,.gdpar_validate_bspline_boundary_range) resolves interior knots (fromknotsordf) and boundary knots and validates the reference range;boundary_knotsdefaults torange(c(knots, tk)); -
user: an arbitrary
basis_fnof declareddim.
materialize_W_basis() populates dim, p, and block_indices (the per-coordinate column blocks) once as_per_k() reshapes to per-coordinate form. The anchoring constraint (C4) apply_W_basis_diff mechanism, selected by a W_type_id). Detail: Part IV, R/W_basis.R; Stan-side Cox–de Boor: Part V.
Activated by group = ~ factor in gdpar(), the scalar/coord-wise reference is promoted to a per-group anchor group = NULL reduces bit-exactly to the single-anchor regime. The anti-aliasing condition (C7) (§II.1.9) is enforced pre-fit by .check_group_aliasing_c7(). Anchor resolution across regimes is handled by resolve_anchor, resolve_anchor_multi, resolve_anchor_K; extraction of grouped references by the .extract_theta_ref_*_grouped helpers (Part IV, R/gdpar.R, R/methods.R).
Because the AMM produces individual parameters, individual treatment effects follow directly. gdpar_causal_bridge() implements a T-learner: fit the anchored model separately under treatment and control and read the individual CATE/ITE as the difference of anchored individual predictions,
.summarize_cate). A battery of pre-checks (.check_bridge_path/_hierarchical/_family/_dim/_amm/_anchor) guards the bridge's applicability. The second layer, gdpar_compare_meta_learners(), benchmarks the AMM learner against external meta-learners through a pluggable adapter registry: gdpar_adapter_grf (R, generalized random forests) and gdpar_adapter_econml (Python EconML via reticulate, e.g. CausalForestDML realizing orthogonal/DML CATE). Adapters honor a two-layer contract (fit_predict_fun + optional predict_fun). Detail: Part IV, R/causal_bridge.R, R/compare_meta_learners.R, R/adapter_*.R; theory: vignettes v08, v08b, v08c.
For geometrically hostile posteriors (funnels, near-determinism, heavy tails, multimodality), the package ships an opt-in geometry engine whose default path is bit-identical to ordinary HMC. When enabled it climbs a ladder of metrics
-
Euclidean (
gdpar_geom_metric_euclidean) — baseline mass matrix; -
Riemannian / Fisher (
gdpar_geom_metric_gp_fisher,gdpar_geom_metric_riemannian) with the SoftAbs regularization of the Hessian eigenvalues,$\lambda\mapsto\lambda\coth(\alpha\lambda)$ , giving a positive-definite metric from a possibly-indefinite Hessian; log-Cholesky parametrization of$G$ and its differentials ($dM/d\psi$ ); -
sub-Riemannian (
gdpar_geom_metric_subriemannian) — a degenerate/constrained metric flowing along admissible directions; -
relativistic / Finsler (
gdpar_geom_metric_relativistic) — a relativistic kinetic energy capping velocities (heavy-tail/ill-conditioning robustness), with its own radial integrator.
A certifying orchestrator (gdpar_geom_orchestrate, with _criteria and _budget variants) diagnoses the pathology (gdpar_geometry_diagnostic: multimodality, heavy kurtosis, boundary proximity, difficulty curve), selects an entry rung, builds the metric, tunes gdpar_geom_certificate). A Laplace fallback (gdpar_geom_laplace: Newton/Laplace climb, observed information, unconstrained draws, fit-quality label) provides a plug-in posterior and an ELPD on par with mgcv-REML / INLA-Laplace when full sampling is certified infeasible (the resolution of the near-deterministic Tweedie case). Detail: Part IV, R/geometry_engine.R, R/geometry_orchestrator.R, R/geometry_suite.R, R/geometry_bridge.R, R/geometry_laplace.R, R/geometry_diagnostic.R; theory: vignette vop08.
gdpar does not model dependence in its point structure; it makes the inference robust to unmodelled dependence (point estimates unchanged, only uncertainty made robust). Two axes:
-
Temporal (
gdpar_dependence_diagnostic,gdpar_dependence_robust): diagnostics = lag-1 autocorrelation, Durbin–Watson, Ljung–Box on residuals; robust SE/intervals via moving/circular block bootstrap with a data-driven block length. The automatic length is the Politis–White (2004) + Patton–Politis–White (2009) flat-top rule (a base-R hand-roll equal tonp::b.star): flat-top autocovariance + adaptive bandwidth$b=(2\hat g^2/D)^{1/3}n^{1/3}$ ,$D=\tfrac43 \text{spec}^2$ ; defaultblock_length=NULLreduces bit-exactly to the$n^{1/3}$ Künsch rate. -
Spatial (
gdpar_spatial_dependence_diagnostic,gdpar_spatial_dependence_robust): diagnostic = Moran's$I$ (hand-roll, nospdep/sf) with knn row-standardized / distance-band / user-supplied weights, two-sided permutation default + analytic Cliff–Ord option; robust inference via tiled randomized-origin spatial block bootstrap (Politis–Romano–Lahiri) with variance-optimal block side$g=\max(2,\lceil n^{1/4}\rceil)$ in$d=2$ , plus a data-driven subsampling calibration of$g$ .
Both axes work on the EB scalar path and the FB path (gdpar_fit and gdpar_eb_fit) via a shared engine (.gdpar_dependence_robust_engine) with class-dispatched estimate/SE/residual extractors and a frozen RNG contract that keeps the EB route bit-exact. Detail: Part IV, R/dependence_robust.R; theory: vignette vop09.
← Part I — Conceptual Framework · gdpar Wiki Home · Part III — Computational Architecture →
- Part I — Conceptual Framework
- Part II — Mathematical Foundations
- Part III — Computational Architecture
- Part IV — Exhaustive Function Reference (1/7)
- Part IV — Exhaustive Function Reference (2/7)
- Part IV — Exhaustive Function Reference (3/7)
- Part IV — Exhaustive Function Reference (4/7)
- Part IV — Exhaustive Function Reference (5/7)
- Part IV — Exhaustive Function Reference (6/7)
- Part IV — Exhaustive Function Reference (7/7)
- Part V — Stan Templates (1/3)
- Part V — Stan Templates (2/3)
- Part V — Stan Templates (3/3)
- Part VI — Data, Benchmarks, Tests & References