This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git
The following commit(s) were added to refs/heads/master by this push:
new ee51343 Add more reference data for Poisson distribution test
ee51343 is described below
commit ee51343ee460477dd6942c2cb3df6a9396550d64
Author: aherbert <[email protected]>
AuthorDate: Mon Oct 25 14:42:47 2021 +0100
Add more reference data for Poisson distribution test
---
.../distribution/test.poisson.5.properties | 65 +++++++++++++++------
.../distribution/test.poisson.6.properties | 66 +++++++++++++++-------
2 files changed, 92 insertions(+), 39 deletions(-)
diff --git
a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.5.properties
b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.5.properties
index 2621f2e..7157cb2 100644
---
a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.5.properties
+++
b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.5.properties
@@ -15,29 +15,58 @@
# Large mean (2^31, exceeds the maximum integer value so the distribution is
truncated)
parameters = 2147483648
-# TODO: Not very accurate. Check other implementations.
-tolerance.relative = 1e-4
+# TODO: Not very accurate for the CDF and SF.
+# Reference values are from matlab.
+# Reference values have been cross validated using scipy stats and R.
+# CDF/SF values from other implementations are with 1e10 of the matlab results
(see below).
+# scipy stats does not have a high accuracy PMF. The values from R and matlab
agree
+# and the current SaddlePointExpansion function matches these to 1e-14.
+tolerance.relative = 1e-5
mean = 2147483648
variance = 2147483648
lower = 0
-# Reference values are from scipy stats poisson using the ppf
cdf.points = \
2147311307, 2147340445, 2147375838, 2147407424, 2147424261, 2147444646,\
2147459347, 2147471905, 2147483646, 2147483647
cdf.values = \
- 1.0000101238876217e-04, 1.0000273128949544e-03,\
- 9.9970874069040833e-03, 5.0000657545971987e-02,\
- 1.0000647606961661e-01, 2.0000045990396950e-01,\
- 3.0000629335033380e-01, 3.9998333790992729e-01,\
- 4.9998852153353818e-01, 4.9999713038338445e-01
+ 0.000100001012387873 0.00100002731289315 0.00999708740695301 \
+ 0.0500006575457684 0.100006476069800 0.200000459903721 \
+ 0.300006293350266 0.399983337909858 0.499988521533539 \
+ 0.499997130383385
pmf.values = \
- 8.5421363725819175e-09, 7.2660387114000581e-08,\
- 5.7498205694262826e-07, 2.2256088451602918e-06,\
- 3.7873037593958561e-06, 6.0413452331395675e-06,\
- 7.5030465291363584e-06, 8.3369210421503014e-06,\
- 8.6088507533104539e-06, 8.6088507533104539e-06
-logpmf.values = \
- -18.57825469970703 , -16.437469482421875, -14.368927001953125,\
- -13.015480041503906, -12.483856201171875, -12.016883850097656,\
- -11.800201416015625, -11.694816589355469, -11.6627197265625 ,\
- -11.6627197265625
+ 8.54204406649840e-09, 7.26600783118927e-08, 5.74980516922681e-07,\
+ 2.22559338517785e-06, 3.78727286070677e-06, 6.04134054183580e-06,\
+ 7.50298080972715e-06, 8.33685886179152e-06, 8.60884984227206e-06,\
+ 8.60884984628087e-06
+sf.values = \
+ 0.999899998987612 0.998999972687107 0.990002912593047 \
+ 0.949999342454232 0.899993523930200 0.799999540096279 \
+ 0.699993706649734 0.600016662090142 0.500011478466462 \
+ 0.500002869616615
+
+# scipy stats
+#cdf.values = \
+# 1.0000101238876217e-04, 1.0000273128949544e-03,\
+# 9.9970874069040833e-03, 5.0000657545971987e-02,\
+# 1.0000647606961661e-01, 2.0000045990396950e-01,\
+# 3.0000629335033380e-01, 3.9998333790992729e-01,\
+# 4.9998852153353818e-01, 4.9999713038338445e-01
+#sf.values = \
+# 0.99989999898761128261, 0.99899997268710505338,\
+# 0.9900029125930959184 , 0.94999934245402795074,\
+# 0.89999352393038334341, 0.79999954009603047034,\
+# 0.69999370664966620303, 0.60001666209007276098,\
+# 0.50001147846646187833, nan
+
+# R
+#cdf.values = \
+# 0.00010000101238876250821 0.00100002731289495529199 \
+# 0.00999708740690409200513 0.05000065754597201456155 \
+# 0.10000647606961658719893 0.20000045990396947415135 \
+# 0.30000629335033379696540 0.39998333790992723901780 \
+# 0.49998852153353817717729 0.49999713038338444714981
+#sf.values = \
+# 0.99989999898761117159 0.99899997268710505338 0.99000291259309591840 \
+# 0.94999934245402795074 0.89999352393038345443 0.79999954009603047034 \
+# 0.69999370664966620303 0.60001666209007264996 0.50001147846646176731 \
+# 0.50000286961661555285
diff --git
a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.6.properties
b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.6.properties
index 45f804c..95a0bce 100644
---
a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.6.properties
+++
b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.poisson.6.properties
@@ -15,35 +15,59 @@
# Large mean (2^30 * 1.5, exceeds the supported range for the PoissonSampler)
parameters = 1610612736.0
-# TODO: Not very accurate. Check other implementations.
+# TODO: Not very accurate for the CDF and SF.
+# Reference values are from matlab.
+# Reference values have been cross validated using scipy stats and R.
+# CDF/SF values from other implementations are with 1e8 of the matlab results
+# with the exception of the extreme lower/upper x point for scipy which is
1e-6.
+# Matlab and R agree more closely at this point.
+# scipy stats does not have a high accuracy PMF. The values from R and matlab
agree
+# and the current SaddlePointExpansion function matches these to 1e-14.
tolerance.relative = 1e-5
mean = 1610612736
variance = 1610612736
lower = 0
-# Reference values are from scipy stats poisson
cdf.points = \
1610452208, 1610492340, 1610532472, \
1610572604, 1610612736, 1610652868, \
1610693000, 1610733132, 1610773264
cdf.values = \
- 3.16704545277469494e-05, 1.34994771620792087e-03,\
- 2.27512432610545989e-02, 1.58660577269995412e-01,\
- 5.00007613750695579e-01, 8.41345237492141296e-01,\
- 9.77248787520595852e-01, 9.98649858900940601e-01,\
- 9.99968316351697473e-01
+ 3.16704406779036e-05 0.00134995175759097 0.0227513157236621 \
+ 0.158660921258167 0.500006627095702 0.841345108157004 \
+ 0.977248684315580 0.998649864180553 0.999968316218515
pmf.values = \
- 3.33458673185959287e-09, 1.10433086816004676e-07,\
- 1.34536580959954562e-06, 6.02939624178527286e-06,\
- 9.94064214999183118e-06, 6.02932724121602734e-06,\
- 1.34538633840926817e-06, 1.10449938853452861e-07,\
- 3.33599899955430242e-09
-logpmf.values = \
- -19.51891708374023438, -16.01885604858398438, -13.5188446044921875,\
- -12.01886367797851562, -11.51887893676757812, -12.0188751220703125,\
- -13.518829345703125 , -16.01870346069335938, -19.51849365234375
+ 3.33457916373466e-09, 1.10433215078793e-07, 1.34536762949409e-06,\
+ 6.02942126680191e-06, 9.94064355219809e-06, 6.02932110890480e-06,\
+ 1.34538997627176e-06, 1.10449725905628e-07, 3.33601963587828e-09
sf.values = \
- 9.99968329545472212e-01, 9.98650052283792111e-01,\
- 9.77248756738945401e-01, 8.41339422730004616e-01,\
- 4.99992386249304421e-01, 1.58654762507858649e-01,\
- 2.27512124794041967e-02, 1.35014109905945011e-03,\
- 3.16836483025270742e-05
+ 0.999968329559322 0.998650048242409 0.977248684276338 \
+ 0.841339078741833 0.499993372904298 0.158654891842996 \
+ 0.0227513156844198 0.00135013581944684 3.16837814853597e-05
+
+# scipy stats
+#cdf.values = \
+# 3.16704545277469494e-05, 1.34994771620792087e-03,\
+# 2.27512432610545989e-02, 1.58660577269995412e-01,\
+# 5.00007613750695579e-01, 8.41345237492141296e-01,\
+# 9.77248787520595852e-01, 9.98649858900940601e-01,\
+# 9.99968316351697473e-01
+#sf.values = \
+# 9.99968329545472212e-01, 9.98650052283792111e-01,\
+# 9.77248756738945401e-01, 8.41339422730004616e-01,\
+# 4.99992386249304421e-01, 1.58654762507858649e-01,\
+# 2.27512124794041967e-02, 1.35014109905945011e-03,\
+# 3.16836483025270742e-05
+
+# R
+#cdf.values = \
+# 3.1670440678036128931e-05 1.3499517575948766484e-03 \
+# 2.2751315723702245086e-02 1.5866092125838993088e-01 \
+# 5.0000662709570131703e-01 8.4134510815686192053e-01 \
+# 9.7724868431562661453e-01 9.9864986418055179396e-01 \
+# 9.9996831621851445249e-01
+#sf.values = \
+# 9.9996832955932191123e-01 9.9865004824240521941e-01 \
+# 9.7724868427629774104e-01 8.4133907874161006912e-01 \
+# 4.9999337290429873848e-01 1.5865489184313807947e-01 \
+# 2.2751315684373406290e-02 1.3501358194481719987e-03 \
+# 3.1683781485462992721e-05