
Get the default optimization dispatch policy
Source:R/globals.R
get_optimization_dispatch_policy.RdReturns EDI's built-in policy table, consulted by the internal (non-exported)
dispatcher edi_optimization_dispatch_policy(), for choosing which
optimization algorithm ("newton_raphson", "lbfgs", or
"irls") an inference class's C++ model-fitting backend uses by default.
Value
A named list with components default_alg (the fallback
algorithm, "newton_raphson" in the built-in policy) and
inference_class_overrides (a named character vector: regular-expression
pattern names to algorithm-name values, matched against the inference class
name).
Which algorithm converges fastest/most reliably per family is partly a
hardware fact (relative cost of Hessian solves vs. L-BFGS iterations
depends on BLAS and cache), so these defaults, computed on the
maintainer's machine, are not necessarily optimal on yours. Run
tune_EDI_for_this_machine to re-measure this axis on your
own machine — it will only switch a family's algorithm when the
candidate converges on every benchmark replicate, never trading speed
for a convergence failure.
Details
The dispatcher checks the inference class name against
inference_class_overrides's named regular-expression patterns in list
order, returning the associated algorithm string at the first match; if none
match, it falls back to default_alg ("newton_raphson"). Unlike
get_bootstrap_dispatch_policy, there is no separate
design-class-scoped override table here — only a single flat pattern list.
The built-in overrides are empirical, chosen per model family based on which
algorithm converges fastest/most reliably for that likelihood surface in
practice — e.g. plain-vanilla generalized linear models with a canonical or
near-canonical link (Poisson, quasi-Poisson, robust Poisson, various incidence
models) default to "irls", most non-canonical-link and ordinal/survival
models default to "lbfgs", and stratified Cox PH and most matched
(KK*GLMM-adjacent) models default to "newton_raphson".
See also
get_bootstrap_dispatch_policy and
get_cold_start_dispatch_policy for the analogous policies
controlling bootstrap CI type and cold-start behavior;
.normalize_optimizer_algorithm for how a resolved algorithm
string is validated/normalized before being passed to a C++ backend;
tune_EDI_for_this_machine to re-benchmark this policy on
your own hardware.
Examples
get_optimization_dispatch_policy()
#> $default_alg
#> [1] "newton_raphson"
#>
#> $inference_class_overrides
#> ^InferenceCountKKGLMM$
#> "newton_raphson"
#> KKGLMM$
#> "lbfgs"
#> GLMMWeibullFrailtyNormalIVWC$
#> "lbfgs"
#> GLMMWeibullFrailtyNormalOneLik$
#> "lbfgs"
#> KKHurdlePoissonIVWC$
#> "lbfgs"
#> KKHurdlePoissonOneLik$
#> "lbfgs"
#> KKCondPoissonOneLik$
#> "lbfgs"
#> InferenceCountPoisson$
#> "irls"
#> InferenceCountQuasiPoisson$
#> "irls"
#> InferenceCountRobustPoisson$
#> "irls"
#> InferenceCountNegBin$
#> "lbfgs"
#> InferenceIncidModifiedPoisson$
#> "irls"
#> InferenceIncidLogRegr$
#> "irls"
#> InferenceIncidProbitRegr$
#> "irls"
#> InferencePropFractionalLogit$
#> "irls"
#> InferencePropGCompMeanDiff$
#> "irls"
#> InferencePropBetaRegr$
#> "lbfgs"
#> InferenceOrdinalAdjCatLogitRegr$
#> "lbfgs"
#> InferenceOrdinalContRatioRegr$
#> "lbfgs"
#> InferenceOrdinalPropOddsRegr$
#> "lbfgs"
#> InferenceOrdinalOrderedProbitRegr$
#> "lbfgs"
#> InferenceOrdinalCauchitRegr$
#> "lbfgs"
#> InferenceOrdinalCloglogRegr$
#> "lbfgs"
#> InferenceSurvivalWeibullRegr$
#> "lbfgs"
#> InferenceSurvivalStratCoxPHRegr$
#> "newton_raphson"
#> InferenceSurvivalGLMMWeibullFrailtyLoggammaOneLik$
#> "lbfgs"
#> InferenceIncidKKCondLogitGLMMOneLik$
#> "lbfgs"
#>