Select ancestry K from fit metrics and replicate stability
ancestry_k_selection.RdSummarizes replicate-level ancestry fit metrics, applies direction-aware optimization, detects performance plateaus, incorporates replicate stability, and returns transparent backend-specific and cross-backend K recommendations with confidence scores and machine-readable reasons.
Usage
select_ancestry_k(x, metric = NULL, direction = NULL,
consensus = NULL, confidence = 0.95, plateau_fraction = 0.01,
stability_threshold = 0.95)
validate_ancestry_k_selection(x)
ancestry_k_selection_text(x)Arguments
- x
A
PopgenVCFAncestryResult, list of ancestry replicates, or K-selection object for validation and text generation.- metric
Optional backend metric name. A backend-specific default is selected when omitted.
- direction
Optional optimization direction, either
minimizeormaximize.- consensus
Optional consensus ancestry object or list of objects supplying replicate stability by backend and K.
- confidence
Confidence level for empirical replicate metric intervals.
- plateau_fraction
Relative fit-improvement threshold used for plateau detection.
- stability_threshold
Minimum replicate stability considered strong.