Skip to contents

DPprior_fit() constructs one canonical \(K_J\) target, or accepts one from DPprior_target_K, dispatches to A1, A2-MN, or A2-KL, and returns the numerical producer's native canonical result without flattening or reinterpreting its evidence.

Usage

DPprior_fit(
  J,
  mu_K = NULL,
  var_K = NULL,
  confidence = c("medium", "low", "high"),
  method = c("A2-MN", "A1", "A2-KL"),
  target_pmf = NULL,
  check_diagnostics = TRUE,
  warn_dominance = NULL,
  M = .QUAD_NODES_DEFAULT,
  verbose = FALSE,
  warning_policy = NULL,
  a1_projection = c("error", "nearest"),
  cv_K = NULL,
  K_interval = NULL,
  target_K = NULL,
  ...
)

Arguments

J

Integer design size. When target_K is supplied, J must match the target exactly.

mu_K, var_K

Optional direct target mean and variance.

confidence

Optional "low", "medium", or "high" qualitative uncertainty route.

method

One of "A2-MN", "A1", or "A2-KL".

target_pmf

Optional strict target PMF on \(1,\ldots,J\).

check_diagnostics

Whether to attach freshly verified canonical diagnostics.

warn_dominance

Deprecated first-size-biased-weight warning adapter.

M

Selected quadrature order.

verbose

Whether the numerical producer prints progress.

warning_policy

Optional ordinary list with exact canonical fields estimand, direction, weight_threshold, and action_threshold. The legacy threshold field is accepted here and normalized immediately for compatibility.

a1_projection

A1 projection policy: "error" or an explicit opt-in to "nearest".

cv_K

Optional coefficient of variation \(SD(K_J)/E(K_J)\).

K_interval

Optional canonical interval-target specification.

target_K

Optional validated dpprior.target/1 K target. It cannot be combined with scalar target arguments.

...

Must be empty.

Value

A canonical dpprior.result/1 DPprior_fit object. Use parameters$a and parameters$b for the Gamma shape and rate; target$K, achieved, and residuals for the scientific claim; and computation, verification, and provenance for its audit trail. A result is decision-ready only when its mode-specific contract and status, usable, and verified fields permit that use. If a backend signals a typed calibration condition, the canonical target or result is retained in condition$result.

Details

Supply exactly one uncertainty route: direct var_K, confidence, cv_K, K_interval, or target_pmf. A pre-built target_K is an alternative to all scalar target arguments. Compatibility aliases are non-authoritative; new code should use the canonical nested fields.

Examples

target <- DPprior_target_K(J = 50, mu_K = 5, var_K = 8)
fit <- DPprior_fit(
  J = 50, target_K = target, method = "A2-MN",
  check_diagnostics = FALSE
)
fit$parameters
#> $a
#> [1] 2.036093
#> 
#> $b
#> [1] 1.605054
#> 
#> $parameterization
#> [1] "log(shape), log(rate)"
#> 
fit[c("status", "usable", "verified")]
#> $status
#> [1] "converged"
#> 
#> $usable
#> [1] TRUE
#> 
#> $verified
#> [1] TRUE
#>