This is an automated email from the ASF dual-hosted git repository. robertlazarski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
commit f26c3324da31d149fbc02a8410ae3f5b478352d4 Author: Robert Lazarski <[email protected]> AuthorDate: Thu May 7 10:32:59 2026 -1000 Fix percentile estimator Javadoc to match ceil(p*N)-1 implementation The Javadoc for MonteCarloRequest.percentiles still described the old floor(p*N) estimator after the implementation was changed to ceil(p*N)-1. Updated to accurately describe the current behavior and note cross-platform parity with Axis2/C. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --- .../springboot/webservices/MonteCarloRequest.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/webservices/MonteCarloRequest.java b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/webservices/MonteCarloRequest.java index c9d07361ad..830d69fdf4 100644 --- a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/webservices/MonteCarloRequest.java +++ b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/webservices/MonteCarloRequest.java @@ -192,17 +192,16 @@ public class MonteCarloRequest { * tail probability directly. * * <p>Estimator convention (important for reconciliation): - * This service uses {@code floor(p × N)} to index into the + * This service uses {@code ceil(p × N) − 1} to index into the * ascending-sorted final-value array. For {@code p = 0.05} and - * {@code N = 10,000} that means index 500, which is the 501-st - * smallest outcome. Some risk systems instead use - * {@code ceil(p × N) − 1} (index 499, the 500-th smallest). The - * two conventions differ by exactly one observation and produce - * VaR estimates that agree to O(1/N) — immaterial for typical - * N > 1,000 but worth noting when reconciling against another - * system. The estimator here matches the CVaR estimator in the - * service (CVaR averages indices 0 .. floor(p × N) − 1, so VaR is - * the first value OUTSIDE that tail set). + * {@code N = 10,000} that selects index 499 (the 500th smallest + * outcome). This corresponds to the k-th order statistic such + * that at least {@code p × N} observations are less than or equal + * to the VaR level — a standard quantile definition. Some risk + * systems use {@code floor(p × N)} (index 500, the 501st smallest), + * which differs by exactly one observation; the difference is + * O(1/N) and immaterial for typical N > 1,000. This estimator + * matches Axis2/C for cross-platform reconciliation. * * <p>Default: [0.01, 0.05] (1% and 5% tail, i.e., 99% and 95% VaR). * Up to 8 entries; extras are silently truncated.
