enforce_monotonicity.RdEnforce monotonicity of quantiles to fix crossing
enforce_monotonicity(quantiles, method = "sort", weights = NULL)Tensor. Predicted quantiles that may have crossing violations.
Shape: (*batch_shape, num_quantiles).
Character. Method for fixing crossing:
"sort": Sort values (fast, default)
"isotonic": Pool Adjacent Violators (optimal L2, O(N))
"cummax": Cumulative maximum (fast but distorts distribution)
Tensor or NULL. Case weights for PAVA method.
Shape: (*batch_shape, num_quantiles) or NULL.
Tensor. Monotonically non-decreasing quantiles.
Shape: (*batch_shape, num_quantiles).