Skip to content

Implemented source map

Status — Stable

Mirrors drmTMB's Implemented source map. This page is a guided tour of the main src/ files wired into the module (via src/DRM.jl), taken straight from the source; it is not the complete include list — src/DRM.jl itself is. The src/experimental/ migrations are not yet part of the public API.

DRM.jl loads in three layers: the verified q=4 engine, the bf/drm front end + Gaussian family, and the non-Gaussian families on a shared sparse-Laplace spine — then post-fit, inference, and output. Everything below is included from src/DRM.jl.

Verified engine core

The selling-point model — the q=4 phylogenetic bivariate location–scale model (PLSM) — fits through a sparse augmented-state Laplace approximation with an exact O(p) gradient. The files form a single migrated chain (top calls down):

FileRole
fit_q4_sparse_tmb.jlSparse "TMB-like" exact-gradient fit of the q=4 PLSM — the engine entry point (includes the chain below).
fit_ml_q4.jlML fit by ascending the true ML Laplace objective.
sparse_em_fit.jlLaplace-EM on the validated sparse augmented foundation.
sparse_aug_plsm.jlThe sparse augmented-state Laplace-EM core for the q=4 PLSM.
sparse_phy.jlAugmented-state sparse phylogenetic precision (never forms a dense p×p Σ).
takahashi_selinv.jlTakahashi selected inverse for sparse positive-definite matrices (the O(p) gradient correction).
reml_q4.jlREML for the q=4 PLSM (drm(method = :REML)): the restricted objective over the augmented state (u, β) with its exact O(p) gradient — see The exact gradient of the q=4 REML objective.

Front end + Gaussian family

FileRole
gaussian_core.jlPublic formula front end (bf / drm_formula / drm) + the univariate Gaussian location–scale fitter.
gaussian_bivariate.jlBivariate Gaussian location–scale with predictor-dependent residual correlation ρ12 (keyword bf).
gaussian_ranef.jlOrdinary Gaussian random intercepts / slopes on the mean (and the scale-RE GHQ marginal).
gaussian_meta.jlGaussian meta-analysis with known sampling (co)variances (meta_V).
gaussian_structured.jlStructured random effects (relmat / animal / phylo / spatial) on the Gaussian mean.
location_only.jlExact-Gaussian location-only phylogenetic mean REML diagnostics and internal row contracts.

Non-Gaussian families

All non-Gaussian families share one reusable Laplace spine:

FileRole
sparse_laplace_glmm.jlReusable sparse-Laplace spine for non-Gaussian GLMMs (the crossed/structured RE path).
student.jlStudent-t: robust location–scale–shape regression.
poisson.jlPoisson: log-link counts.
negbinomial.jlNegative-binomial (NB2) for overdispersed counts (incl. the truncated variant).
beta.jlBeta for responses on the open interval (0, 1).
betabinomial.jlBeta-binomial: successes out of known trials, overdispersed.
binomial.jlBinomial / Bernoulli: classic logistic regression.
gamma.jlGamma for strictly-positive continuous responses.
lognormal.jlLogNormal for strictly-positive responses whose log is Gaussian.
zeroonebeta.jlZero-one-inflated beta for the closed interval [0, 1].
tweedie.jlTweedie (compound Poisson–Gamma, 1 < p < 2): semicontinuous responses.
cumulative.jlCumulative-logit ordinal regression.

Post-fit, inference, and output

FileRole
inference.jlWald + profile-likelihood inference (and parametric bootstrap) for a fitted DrmFit.
summary.jlHuman-readable printout for a fitted DrmFit.
visualization.jlPlotting-data providers (profile_curve / parameter_surface / corpairs_data), mirroring drmTMB's visualization layer. Drawing itself is an optional extension — src/plotting_ext.jl + ext/DRMMakieExt.jl — whose methods load only with the Makie + AlgebraOfGraphics weakdeps.

Not yet wired — src/experimental/

Some migrated comparison-suite engines and natural-gradient variants remain outside the public API. Several are kept as recorded negative results, not as pending promotions: fit_em_natgrad.jl failed the #13 decision gate, so algorithm = :natgrad is deliberately not exposed, and fit_em_closed.jl / em_squarem_fit.jl rest on a closed-form Λ step whose reported #472 descent proved to be an artefact of a dropped-zeros sparsity pattern and was repaired in #577 — test/test_lambda_p100.jl now asserts that the step ascends the marginal — so they stay unwired pending a case for promotion rather than as a recorded failure. The rest are superseded predecessors of the production engine (the estep_* mode-finder variants) or diagnostic oracles kept for reproducibility. Nothing is wired from there without a GitHub issue making the case — see src/experimental/README.md.