Skip to contents

Creates a comparison dashboard showing K-only vs dual-anchor solutions. Displays changes in alpha, K, and the first size-biased weight \(W_{SB}\) side-by-side.

Usage

plot_dual_comparison(
  fit_dual,
  fit_K_only = NULL,
  engine = c("ggplot2", "base"),
  base_size = 10,
  title = NULL,
  show = TRUE
)

Arguments

fit_dual

A canonical hard or soft dual fit from DPprior_dual_hard() or DPprior_dual_soft(). Retained legacy fits have no authoritative comparison lineage and raise a typed unavailable condition.

fit_K_only

Optional canonical K-only fit. If supplied, it must exactly match the authoritative provenance.input_fit reference retained by fit_dual.

engine

"ggplot2" (default) or "base".

base_size

Base font size.

title

Optional title for the dashboard.

show

If TRUE, draw the plot.

Value

A gtable grob or list of ggplot objects.

Examples

fit_K <- DPprior_fit(J = 50, mu_K = 5, var_K = 8)
fit_dual <- DPprior_dual_soft(
  fit_K,
  target = list(
    metric = "wsb_tail", relation = "target",
    threshold = 0.5, value = 0.3
  ),
  lambda = 0.5
)
plot_dual_comparison(fit_dual)

#> TableGrob (3 x 2) "dpprior_dashboard": 5 grobs
#>   z     cells              name                 grob
#> 1 1 (2-2,1-1) dpprior_dashboard       gtable[layout]
#> 2 2 (3-3,1-1) dpprior_dashboard       gtable[layout]
#> 3 3 (2-2,2-2) dpprior_dashboard       gtable[layout]
#> 4 4 (3-3,2-2) dpprior_dashboard       gtable[layout]
#> 5 5 (1-1,1-2) dpprior_dashboard text[GRID.text.1715]