Skip to contents

Core Elicitation

Main user-facing functions for prior elicitation

DPprior_fit()
Fit a Gamma Hyperprior for DP Concentration Parameter
DPprior_dual()
Dual-Anchor Prior Calibration

Approximation Algorithms

A1 closed-form and A2 Newton-based algorithms

DPprior_a1()
A1 Closed-Form Prior Elicitation
DPprior_a2_newton()
A2-MN Exact-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)
get_log_stirling()
Get Single Log-Stirling Value with Bounds Checking
get_stirling_row()
Get Stirling Numbers for a Fixed J

K Distribution (Conditional)

Antoniak distribution P(K | α)

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
summary_K_given_alpha()
Summary of Conditional Moments
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 α

pmf_K_marginal()
Marginal PMF of K_J under Gamma Hyperprior
log_pmf_K_marginal()
Log 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()
Exact Marginal Moments of K_J under Gamma Prior

Weight Distribution (w₁)

Distribution of the largest stick-breaking weight

mean_w1()
Mean of w₁
var_w1()
Variance of w₁
prob_w1_exceeds()
Survival Function of w₁
quantile_w1()
Quantile Function of w₁
density_w1()
Density of w₁
cdf_w1()
CDF of First Stick-Breaking Weight w₁
rw1()
Random Generation from w₁ Distribution
summary_w1()
Summary Statistics for w₁ Distribution
w1_grid()
Compute w₁ Distribution on Grid

Co-clustering Probability (ρ)

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
mean_rho_sq()
Marginal Second Moment of rho
mean_rho_sq_given_alpha()
Conditional Second Moment 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()
Quick Dominance Risk Check
dual_anchor_diagnostics()
Dual-Anchor Diagnostic Comparison
compare_diagnostics()
Compare Diagnostics Across Multiple Fits
compare_a1_a2()
Compare A1 vs A2 Accuracy
compare_rho_w1()
Compare rho and w1 Distributions
compare_to_negbin()
Compare Exact Moments to NegBin Approximation

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 w1
plot_prior_dashboard()
4-Panel Prior Dashboard
plot_dual_comparison()
Plot Dual-Anchor Comparison Dashboard
plot_dual_dashboard()
Plot Dual-Anchor Extended 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 and summary 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 DPprior_fit to Data Frame
print(<DPprior_diagnostics>)
Print Method for DPprior_diagnostics Objects
summary(<DPprior_diagnostics>)
Summary 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

Utilities

Helper and conversion functions

vif_to_variance()
Convert Variance Inflation Factor to Variance
vif_to_variance_fit()
Convert VIF to Target Variance
confidence_to_vif()
Map a Qualitative Confidence Level to a Variance Inflation Factor (VIF)
confidence_to_vif_fit()
Convert Confidence Level to Variance Inflation Factor
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
log_rising_factorial()
Log Rising Factorial (Pochhammer Symbol)
logsumexp()
Numerically Stable Log-Sum-Exp (Binary)
logsumexp_vec()
Vectorized Log-Sum-Exp
softmax()
Numerically Stable Softmax

Internal Computation

Lower-level computational functions

compute_K_diagnostics()
K Distribution Diagnostics
compute_weight_diagnostics()
Weight Distribution Diagnostics (w1)
compute_alpha_diagnostics()
Alpha Distribution Diagnostics
compute_coclustering_diagnostics()
Co-Clustering Diagnostics (rho)
compute_error_landscape()
Compute A1 Error Landscape
compute_tradeoff_curve()
Compute Pareto Trade-off Curve
compute_linearization_bound()
Mean-Linearization Error Bound
compute_poissonization_bound()
Poissonization Error Bound (Chen-Stein / Le Cam Bound)
compute_total_tv_bound()
Total TV Error Bound (Conditional)
compute_scaling_constant()
Compute Scaling Constant for A1 Mapping
compute_sum_p_squared()
Poissonization Error Bound (Raw Sum of Squared Probabilities)
expected_tv_bound()
Expected TV Bound Under Gamma Prior

Validation & Verification

Internal testing and validation functions

verify_DPprior_fit()
Verify DPprior_fit Module
verify_a1_mapping_all()
Run All Module 10 Verification Tests
verify_a2_all()
Run All A2-MN Verification Tests
verify_a2_kl()
Verify A2-KL Optimization
verify_a2_kl_all()
Run All Module 12 Verification Tests
verify_cdf_properties()
Verify CDF Properties
verify_derivative()
Verify Derivative via Finite Difference
verify_diagnostics()
Verify Diagnostics Module
verify_dual_anchor()
Verify Dual-Anchor Module
verify_jacobian_all()
Run All Module 07 Verification Tests
verify_kl_divergence()
Verify KL Divergence Properties
verify_marginal_moments()
Verify Marginal Moments Properties
verify_moments_marginal_all()
Run All Module 05 Verification Tests
verify_pmf_all()
Run All PMF Verifications
verify_pmf_marginal_all()
Run All Module 06 Verification Tests
verify_pmf_marginal_convergence()
Verify Quadrature Convergence
verify_pmf_marginal_moments()
Verify Moments Consistency
verify_pmf_marginal_properties()
Verify Marginal PMF Properties
verify_pmf_moments()
Verify PMF Consistency with Moments
verify_pmf_normalization()
Verify PMF Normalization
verify_quadrature()
Verify Quadrature Accuracy Against Known Gamma Moments
verify_s3_methods()
Verify S3 Methods Module
verify_stirling_row_sum()
Verify Row Sum Identity for Stirling Numbers
verify_underdispersion()
Verify Underdispersion Inequality
verify_visualization()
Verify Visualization Module
verify_zero_probability()
Verify Zero Probability at K=0
validate_moments_conditional()
Validate Conditional Moments Computation
validate_stirling()
Validate Stirling Number Computation

Other Internal

Other internal helper functions

a1_moment_error()
A1 Approximation Moment Errors
construct_target_pmf()
Construct Target PMF from User Specification
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
summary_pmf_K_given_alpha()
Summary of Conditional PMF