Skip to content

Implementation map

Status — Implemented

Mirrors drmTMB's Implementation map. Where the source map lists files and the model map lists capability status, this page maps each modelling feature → the numerical method that fits it → the fitter entry point in the source. All entries are taken from src/.

Every fit minimises a negative log-likelihood by L-BFGS. Most routes take their gradient from ForwardDiff; the verified sparse engines below instead supply an exact O(p) analytic gradient, because ForwardDiff duals do not flow through the sparse CHOLMOD factorisation those routes rely on. The rows below differ in how the random-effect / correlation integral is handled.

The verified engine (phylogenetic q=4 PLSM)

FeatureMethodEntry point
q=4 phylogenetic bivariate location–scalesparse augmented-state Laplace + exact O(p) gradient (implicit-function, Takahashi selected inverse — never forms dense Σ)fit_q4_sparse_tmb

Gaussian location–scale

FeatureMethodEntry point
fixed effectsdirect ML_fit_fixed_gaussian
random intercept (1|g)closed-form marginal (Woodbury / determinant lemma)_fit_ranef_gaussian
correlated (1+x|g)per-group 2×2 block capacitance, log-Cholesky Σ_fit_correlated_ranef_gaussian
crossed (1|g)+(1|h)whitened-Woodbury dense capacitance M = I + Z̃ᵀD⁻¹Z̃_fit_multi_ranef_gaussian
scale RE sigma ~ (1|g)32-node Gauss–Hermite marginal on log σ_fit_sigma_ranef_gaussian
relmat / animal / phylostructured GLS (determinant lemma + Woodbury, known K)_fit_structured_gaussian
spatial(1|site)exponential kernel K(ρ)=exp(-d/ρ), range estimated_fit_spatial_gaussian
meta-analysis meta_V(v)known-variance GLS + heterogeneity τ_fit_meta_gaussian

Non-Gaussian families

The shared scheme: an explicit, AD-safe log-likelihood; random intercepts by Gauss–Hermite quadrature (b = √2 σ_b z); correlated (1+x|g) by a 2-D GHQ tensor grid; crossed intercepts by the sparse-Laplace spine (sparse_laplace_glmm.jl).

FamilyFixed(1|g)(1+x|g)crossedother
Student-t_fit_student_fit_student_ranef_fit_student_corr_ranef
Poisson_fit_poisson_fit_poisson_ranef_fit_poisson_corr_ranef_fit_poisson_crossed_laplacezi / hu: _fit_poisson_zi / _fit_poisson_hu
NB2_fit_negbin2_fit_negbin2_ranef_fit_negbin2_corr_ranef_fit_nb2_crossed_laplacezi / hu: _fit_negbin2_zi / _fit_negbin2_hu; truncated: _fit_truncated_negbin2
Gamma_fit_gamma_fit_gamma_ranef_fit_gamma_corr_ranef_fit_gamma_crossed_laplace
Beta_fit_beta_fit_beta_ranef_fit_beta_corr_ranef_fit_beta_crossed_laplace
Binomial_fit_binomial_fit_binomial_ranef_fit_binomial_crossed_laplace
Beta-binomial_fit_betabinomial_fit_betabinomial_ranef_fit_betabinomial_corr_ranefcbind(s, f) response
LogNormal_fit_lognormal_fit_lognormal_ranef_fit_lognormal_corr_ranef
Zero-one-inflated Beta_fit_zeroonebetaclosed [0,1]
Tweedie_fit_tweedie_fit_tweedie_ranefcompound Poisson–Gamma; independent slope _fit_tweedie_slope_ranef (correlated (1+x|g) refused)
Cumulative-logit_fit_cumulative_fit_cumulative_ranefordered categorical; independent slope _fit_cumulative_slope_ranef, phylo _fit_cumulative_phylo_laplace (correlated (1+x|g) refused)

Shared spine

ConcernMethodEntry point
crossed / structured non-Gaussian REsparse-Laplace marginal + exact nuisance gradientsparse_laplace_glmm.jl (_fit_crossed_mean_laplace, …_nuisance)
selected inverse for the O(p) correctionTakahashi recursion on the sparse Choleskytakahashi_selinv
inferenceWald (observed information), profile (LR inversion), parametric bootstrapinference.jl

Function names are internal (the public verbs are drm / bf and the accessors); this map is for orientation when reading or extending the source.