Fit a Gamma hyperprior from an occupied-cluster target
DPprior_fit.RdDPprior_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_Kis supplied,Jmust 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, andaction_threshold. The legacythresholdfield 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/1K 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.
See also
Other elicitation:
DPprior_a1(),
DPprior_a2_kl(),
DPprior_a2_newton(),
DPprior_dual(),
DPprior_dual_hard(),
DPprior_dual_soft(),
DPprior_target_K()
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
#>