Helpers for normalizing public posterior-density method arguments and identifying the method that uses precomputed posterior density or ordinate metadata. Only "precomputed" does; packages with their own estimators (e.g., qCMDE or IWMDE) map their method names to "precomputed" themselves.

posterior_density_method_match(
  method,
  allowed = c("KDE", "precomputed"),
  name = "method"
)

posterior_density_method_uses_precomputed(method)

Arguments

method

density method. Method names match exactly: the match is case-sensitive and the whole name is required (no partial matching).

allowed

character vector of allowed density methods.

name

argument name used in error messages.

Value

posterior_density_method_match() returns a scalar character value; the full default vector allowed selects its first method. posterior_density_method_uses_precomputed() returns a scalar logical value.