jmalkin commented on code in PR #184:
URL:
https://github.com/apache/datasketches-website/pull/184#discussion_r1702401959
##########
docs/KLL/UnderstandingKLLBounds.md:
##########
@@ -63,30 +63,20 @@ public class QuantileBoundsTest {
println("r2: " + r2);
println("");
- double r1LB = sk.getRankLowerBound(r1);
- println("r1LB: " + r1LB);
- double r1UB = sk.getRankUpperBound(r1);
- println("r1UB: " + r1UB);
-
- double r2LB = sk.getRankLowerBound(r2);
- println("r2LB: " + r2LB);
- double r2UB = sk.getRankUpperBound(r2);
- println("r2UB: " + r2UB);
+ println("r1LB(r1): " + sk.getRankLowerBound(r1));
+ println("r1UB(r1): " + sk.getRankUpperBound(r1));
+ println("r2LB(r2): " + sk.getRankLowerBound(r2));
+ println("r2UB(r2): " + sk.getRankUpperBound(r2));
println("");
- double q1LB = sk.getQuantileLowerBound(r1);
- println("q1LB(r1): " + q1LB);
- double q1UB = sk.getQuantileUpperBound(r1);
- println("q1UB(r1): " + q1UB);
-
- double q2LB = sk.getQuantileLowerBound(r2);
- println("q2LB(r2): " + q2LB);
- double q2UB = sk.getQuantileUpperBound(r2);
- println("q2UB(r2): " + q2UB);
+ println("q1LB(r1): " + sk.getQuantileLowerBound(r1));
+ println("q1UB(r1): " + sk.getQuantileUpperBound(r1));
+ println("q2LB(r2): " + sk.getQuantileLowerBound(r2));
+ println("q2UB(r2): " + sk.getQuantileUpperBound(r2));
println("");
}
- static void println(Object o) { System.out.println(o.toString()); }
+ private static void println(Object o) { System.out.println(o.toString()); }
Review Comment:
avoiding things like this, which detract from the main focus of the example,
is why i increasingly prefer python for these sorts of things.
##########
docs/KLL/UnderstandingKLLBounds.md:
##########
@@ -119,19 +109,21 @@ The sketch is configured with a k=400, which results in a
normalized rank error
The input stream of 1000 values has a big discontinuity starting at *i* = 501.
So the actual sequence of inputs is 1 to 500 and 601 to 1100.
-<img class="doc-img-half" src="{{site.docs_img_dir}}/kll/QuantileBounds1.png"
alt="QuantileBounds1.png" />
+<img class="doc-img-half" src="../img/kll/QuantileBounds1.png"
alt="QuantileBounds1.png" />
We choose two quantiles on either side of the discontinuity, 500 and 620, and
get their respective ranks of 0.5 and 0.52. Note that because of the
discontinuity the difference in the input quantiles is 120/1100 or ~10.9%,
while the difference in their respective ranks is only 2%.
-Next we compute the upper and lower rank bounds of the two resulting ranks of
0.5 and 0.52, which are given above. Note that the UB - LB of each rank is
about .013 which is 2 X .0067. This means that the true rank of each quantile
is within the UB - LB range of ranks with a confidence of 99%, which is about
+/- 2.6 standard deviations from the mean.
+Next we compute the rank upper bound (UB) and rank lower bound (LB) of the two
resulting ranks of 0.5 and 0.52, which are given above. Note that the UB - LB
of each rank is about .013 which is 2 X .0067. This means that the true rank
of each quantile is within the UB - LB range of ranks with a confidence of 99%,
which is about +/- 2.6 standard deviations from the estimate.
+
+Then we compute the quantile UB and LB of the same two resulting ranks of 0.5
and 0.52. Note that the UB - LB quantile range of *r1* is 114/1100 or 10.4%,
because in between the rank UB and LB is the discontinuity. These points are
shown in the next plot
-Then we compute the upper and lower quantile bounds of the same two resulting
ranks of 0.5 and 0.52. Note that the UB - LB quantile range of *r1* is 114/1100
or 10.4%, because in between the rank UB and LB is the discontinuity. These
points are shown in the next image.
+[//]: # ( {{site.docs_img_dir}} )
Review Comment:
??
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]