Skip to contents

Targets and Core Elicitation

Canonical target construction and K-based calibration

DPprior_target_K()
Construct a Canonical Bounded-Discrete Cluster-Count Target
DPprior_fit()
Fit a Gamma hyperprior from an occupied-cluster target

Dual-Anchor Calibration

Current hard and soft workflows plus the retained v2.x legacy adapter

DPprior_dual_hard()
Dual-anchor calibration with a verified hard inequality
DPprior_dual_soft()
Calibrate a fixed-scale soft Dual-Anchor trade-off
DPprior_dual()
Legacy Dual-Anchor equality-loss adapter

Schema Migration

Conservative validation and upgrade of serialized objects

upgrade_DPprior_object()
Upgrade a serialized DPprior object conservatively

Approximation Algorithms

A1 closed-form and A2 Newton-based algorithms

DPprior_a1()
A1 Closed-Form Prior Elicitation
DPprior_a2_newton()
A2-MN Calibrated-Moment Newton Solver
DPprior_a2_kl()
A2-KL: KL Divergence Minimization for Prior Calibration

Stirling Numbers

Computation of unsigned Stirling numbers of the first kind

compute_log_stirling()
Compute Log Stirling Numbers (First Kind, Unsigned)

K Distribution (Conditional)

Antoniak distribution P(K | alpha)

pmf_K_given_alpha()
PMF of K Given Alpha (Antoniak Distribution)
log_pmf_K_given_alpha()
Log-PMF of K Given Alpha (Antoniak Distribution)
cdf_K_given_alpha()
CDF of K Given Alpha
mean_K_given_alpha()
Conditional Mean of K_J Given Alpha
var_K_given_alpha()
Conditional Variance of K_J Given Alpha
mode_K_given_alpha()
Mode of K Given Alpha
quantile_K_given_alpha()
Quantile of K Given Alpha
moments_K_given_alpha()
Conditional Mean and Variance of K_J Given Alpha
cv_K_given_alpha()
Coefficient of Variation for K Given Alpha
dispersion_K_given_alpha()
Dispersion Index for K Given Alpha

K Distribution (Marginal)

Marginal distribution of K under Gamma prior on alpha

pmf_K_marginal()
Marginal PMF of K_J under Gamma Hyperprior
cdf_K_marginal()
CDF of Marginal K Distribution
mode_K_marginal()
Mode of Marginal K Distribution
quantile_K_marginal()
Quantile of Marginal K Distribution
summary_K_marginal()
Summary Statistics for Marginal K Distribution
K_moments()
Convenience Wrapper for Marginal Moments
exact_K_moments()
Marginal Moments of K_J under Gamma Prior

Weight Distribution (w1)

Distribution of the first stick-breaking / size-biased weight

mean_w1()
Mean of the First Size-Biased DP Weight
var_w1()
Variance of the First Size-Biased DP Weight
prob_wsb_exceeds()
Tail Probability of the First Size-Biased DP Weight
prob_w1_exceeds()
Tail Probability of the First Size-Biased DP Weight
quantile_w1()
Quantile Function of the First Size-Biased DP Weight
density_w1()
Density of the First Size-Biased DP Weight
cdf_w1()
CDF of the First Size-Biased DP Weight
rw1()
Random Generation from the First Size-Biased DP Weight Distribution
summary_w1()
Summary Statistics for the First Size-Biased DP Weight
w1_grid()
Compute the First Size-Biased DP Weight Distribution on a Grid

Maximum-Weight Tail Bounds

Certified W-max bounds and the status-aware deferred direct interface

wmax_tail_bounds()
Certified Bounds for the Largest DP Population Weight Tail
prob_wmax_exceeds()
Largest DP Population Weight Tail Probability

Co-clustering Probability (rho)

Pairwise co-clustering probability functions

mean_rho()
Marginal Mean of rho
var_rho()
Marginal Variance of rho
mean_rho_given_alpha()
Conditional Mean of rho Given Alpha
var_rho_given_alpha()
Conditional Variance of rho Given Alpha
cv_rho()
Coefficient of Variation of rho
rrho()
Random Generation from rho Distribution
summary_rho()
Summary Statistics for rho Distribution
rho_conditional_grid()
Compute rho Conditional Moments on alpha Grid

Diagnostics

Prior validation and diagnostic tools

DPprior_diagnostics()
Comprehensive Prior Diagnostics
DPprior_error_bounds()
Compute A1 Approximation Error Bounds
check_dominance_risk()
Deprecated Ambiguous Weight-Risk Check
dual_anchor_diagnostics()
Compare a Dual-Anchor fit with its K-only start
compare_a1_a2()
Compare A1 vs A2 Accuracy

Visualization

Plotting functions

plot(<DPprior_fit>)
Plot Method for DPprior_fit Objects
plot_alpha_prior()
Plot Prior Density of Alpha
plot_K_prior()
Plot Prior PMF of K_J
plot_w1_prior()
Plot Prior Density of the First Size-Biased DP Weight
plot_prior_dashboard()
4-Panel Prior Dashboard
plot_dual_comparison()
Plot Dual-Anchor Comparison Dashboard
plot_dual_dashboard()
Plot Canonical Dual Comparison Dashboard
plot_tradeoff_curve()
Plot Trade-off Curve
plot_tradeoff_dashboard()
Plot Trade-off Multi-Panel
DPprior_colors()
DPprior Color Palette
theme_DPprior()
Publication-Quality Theme for DPprior Plots

S3 Methods

Print, summary, and coercion methods

print(<DPprior_fit>)
Print Method for DPprior_fit Objects
summary(<DPprior_fit>)
Summary Method for DPprior_fit Objects
print(<summary.DPprior_fit>)
Print Method for summary.DPprior_fit
as.data.frame(<DPprior_fit>)
Coerce a canonical DPprior fit to a data frame
print(<DPprior_diagnostics>)
Print Method for DPprior_diagnostics Objects
summary(<DPprior_diagnostics>)
Summary Method for DPprior_diagnostics Objects
as.data.frame(<DPprior_diagnostics>)
Data-Frame Method for DPprior_diagnostics Objects
print(<DPprior_error_bounds>)
Print Method for DPprior_error_bounds Objects
summary(<DPprior_error_bounds>)
Summary Method for DPprior_error_bounds Objects
print(<w1_summary>)
Print Method for w1_summary Objects
print(<rho_summary>)
Print Method for rho_summary Objects

Numerical Utilities

Conversion, quadrature, and numerical helper functions

vif_to_variance()
Convert Variance Inflation Factor to Variance
confidence_to_vif()
Map a Qualitative Confidence Level to a Variance Inflation Factor (VIF)
cv_alpha_to_variance()
Convert CV(alpha) to Variance
integrate_gamma()
Integrate Function Against Gamma Distribution
build_gamma_quadrature()
Build Quadrature for Gamma(a, b) Integration
gauss_laguerre_nodes()
Gauss-Laguerre Quadrature Nodes and Weights
logsumexp()
Numerically Stable Log-Sum-Exp (Binary)
logsumexp_vec()
Vectorized Log-Sum-Exp
score_a()
Score Function with Respect to Shape Parameter a
score_b()
Score Function with Respect to Rate Parameter b

Computation

Lower-level computational functions

compute_weight_diagnostics()
First size-biased and largest-weight diagnostics
compute_error_landscape()
Compute A1 Error Landscape
compute_tradeoff_curve()
Compute a status-aware soft trade-off path
compute_scaling_constant()
Compute Scaling Constant for A1 Mapping
a1_moment_error()
A1 Approximation Moment Errors
discretize_chisq()
Discretize Chi-Square to K_J Support
kl_divergence_K()
KL Divergence Between Target and Induced K_J PMFs
kl_divergence_pmf()
KL Divergence Between Two PMFs
moments_with_jacobian()
Compute Marginal Moments and Jacobian Simultaneously

Validation & Verification

Functions for verifying mathematical properties

validate_stirling()
Validate Stirling Number Computation
verify_jacobian()
Verify Jacobian Against Finite Differences
verify_underdispersion()
Verify Underdispersion Inequality