Hello R Community,
I'm happy to announce the first public release of gdpar, an R package for fitting models in which a parameter is allowed to vary across individuals or units — without collapsing it to a single global value or treating every unit as fully idiosyncratic.
What does it do?
gdpar estimates individuated parameters by anchoring each unit to a meaningful population reference and modelling its deviation from that reference. Drawing from the package wiki, the core tools let you:
- Decompose any distributional parameter (location, scale, shape, tail index, zero-inflation probability) into a reference plus additive, multiplicative, and modulated deviations.
- Fit the model with hierarchical Bayesian Hamiltonian Monte Carlo (via
cmdstanr), with a cheaper empirical-Bayes regime and an explicit comparator between the two. - Read individual treatment effects (CATE/ITE) through a causal T-learner bridge, benchmarked against established meta-learners.
- Check identifiability before fitting, and keep your uncertainty honest under dependence and heavy tails with robust diagnostics and block bootstrap.
At its core, the package addresses settings where a parameter is neither homogeneous nor fully separate across units — you want interpretable, individual parameters tied to a reference (so that an "average" unit has zero deviation), with calibrated uncertainty. The solution combines a structured parameter decomposition, hierarchical Bayesian inference, and explicit identifiability theory to deliver heterogeneity estimates you can interpret and trust.
Specifically, this library uses the Additive–Multiplicative–Modulated (AMM) canonical form with reference anchoring
θ_i = θ_ref + a(x_i) + b(x_i)·θ_ref + W(θ_ref)·x_i,
estimated by Bayesian MCMC across thirteen response families, with each distributional parameter carrying its own anchored decomposition.
Why is it useful?
Heterogeneity is everywhere, but most workflows either ignore it (one global parameter) or overfit it (one free parameter per unit). gdpar aims for a principled middle ground: a transparent decomposition, identifiability conditions you can audit, and robustness anchors (block bootstrap, dependence diagnostics, an opt-in geometry-adaptive sampler) that make the inference reproducible and defensible.
Getting Started:
- Install from GitHub:
remotes::install_github("IsadoreNabi/gdpar")(a CRAN submission is in progress). The Bayesian path needs CmdStan —cmdstanr::install_cmdstan()sets it up. - Browse the Code & Wiki: GitHub – IsadoreNabi/gdpar
The wiki documents the full conceptualization, mathematics, and computation of the package — from the canonical form and its identifiability theory to every function and Stan template — and the vignettes walk you from a first fit to advanced distributional and causal scenarios. I hope gdpar becomes a useful tool in your applied-statistics and econometrics workflows.
I welcome any feedback, bug reports, or contributions on GitHub. How do you currently handle parameter heterogeneity in your models?
Best,
José Mauricio Gómez Julián