You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/01/24 15:22:32 UTC

[commons-statistics] 01/03: Add t distribution test cases for more degrees of freedom

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

commit 65123f8f64c10545b7df50a3df208a70f5380d75
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Jan 24 13:37:19 2022 +0000

    Add t distribution test cases for more degrees of freedom
    
    Add df=0.25, 0.5, 10, 1e2, 1e4, 1e6, 1e10, 1e14
---
 .../statistics/distribution/test.t.10.properties   | 45 ++++++++++++++++++++++
 .../statistics/distribution/test.t.11.properties   | 39 +++++++++++++++++++
 .../statistics/distribution/test.t.12.properties   | 39 +++++++++++++++++++
 .../statistics/distribution/test.t.5.properties    | 43 +++++++++++++++++++++
 .../statistics/distribution/test.t.6.properties    | 45 ++++++++++++++++++++++
 .../statistics/distribution/test.t.7.properties    | 45 ++++++++++++++++++++++
 .../statistics/distribution/test.t.8.properties    | 45 ++++++++++++++++++++++
 .../statistics/distribution/test.t.9.properties    | 45 ++++++++++++++++++++++
 8 files changed, 346 insertions(+)

diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.10.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.10.properties
new file mode 100644
index 0000000..a16cb02
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.10.properties
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 1e14
+# Limited by density values
+tolerance.relative = 2e-15
+mean = 0
+variance = 1.00000000000002
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.022750131948180554731 0.158655253931458378736 0.308537538725987658950 \
+  0.500000000000000000000 0.524917669029247191403 0.549738224830112809371 \
+  0.598706325682923479192 0.691462461274012341050 0.841344746068541593509 \
+  0.977249868051819459147 0.998650101968369563465 0.999968328758166880021 \
+  0.999999713348428187487
+pdf.values = \
+  5.3990966513189013465e-02 2.4197072451914214408e-01 \
+  3.5206532676429824757e-01 3.9894228040143170366e-01 \
+  3.9816385668688558663e-01 3.9583768694474846805e-01 \
+  3.8666811680284818298e-01 3.5206532676429824757e-01 \
+  2.4197072451914214408e-01 5.3990966513189013465e-02 \
+  4.4318484119386936104e-03 1.3383022576495998785e-04 \
+  1.4867195147364332597e-06
+sf.values = \
+  9.7724986805181945915e-01 8.4134474606854159351e-01 \
+  6.9146246127401234105e-01 5.0000000000000000000e-01 \
+  4.7508233097075286411e-01 4.5026177516988719063e-01 \
+  4.0129367431707657632e-01 3.0853753872598765895e-01 \
+  1.5865525393145837874e-01 2.2750131948180554731e-02 \
+  1.3498980316304252589e-03 3.1671241833142672244e-05 \
+  2.8665157187967719709e-07
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.11.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.11.properties
new file mode 100644
index 0000000..ea43314
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.11.properties
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 0.25
+mean = NaN
+variance = NaN
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.30256179221838608306 0.35565187103704398730 0.40809998934200636400 \
+  0.50000000000000000000 0.51338485776113285119 0.52651704176623193021 \
+  0.55121099071545742731 0.59190001065799369151 0.64434812896295601270 \
+  0.69743820778161391694 0.72596719894069106083 0.74477206090794523252 \
+  0.75852695602285835630
+pdf.values = \
+  0.036568613378051513518 0.078574715291670857442 0.139314179499834794873 \
+  0.214851835757470216448 0.212779951034929082354 0.206863315985674645070 \
+  0.186883220968336150047 0.139314179499834794873 0.078574715291670857442 \
+  0.036568613378051513518 0.022491218837614151971 0.015814964481291767656 \
+  0.012007102281802888716
+sf.values = \
+  0.69743820778161391694 0.64434812896295601270 0.59190001065799369151 \
+  0.50000000000000000000 0.48661514223886714881 0.47348295823376806979 \
+  0.44878900928454257269 0.40809998934200636400 0.35565187103704398730 \
+  0.30256179221838608306 0.27403280105930888366 0.25522793909205476748 \
+  0.24147304397714164370
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.12.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.12.properties
new file mode 100644
index 0000000..d831e7f
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.12.properties
@@ -0,0 +1,39 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 0.5
+mean = NaN
+variance = NaN
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.22275744509156564233 0.30112161084132205158 0.37865903646471832378 \
+  0.50000000000000000000 0.51682198365134712770 0.53345041605242404792 \
+  0.56544011515757452990 0.62134096353528167622 0.69887838915867794842 \
+  0.77724255490843430216 0.81634592200702826847 0.84038995850566422519 \
+  0.85700429842057057606
+pdf.values = \
+  0.051899228247372600209 0.118304657040392585676 0.198963924026172522819 \
+  0.269676300594189677362 0.268106890928048624545 0.263523779599922125527 \
+  0.246875725979702836943 0.198963924026172522819 0.118304657040392585676 \
+  0.051899228247372600209 0.029633133748884075281 0.019586522104539767775 \
+  0.014130747946566201215
+sf.values = \
+  0.77724255490843430216 0.69887838915867794842 0.62134096353528167622 \
+  0.50000000000000000000 0.48317801634865287230 0.46654958394757600759 \
+  0.43455988484242547010 0.37865903646471832378 0.30112161084132205158 \
+  0.22275744509156564233 0.18365407799297175928 0.15961004149433577481 \
+  0.14299570157942942394
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.5.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.5.properties
new file mode 100644
index 0000000..0945346
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.5.properties
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 10.0
+# Limited by SF inverse mapping
+tolerance.relative = 2e-15
+mean = 0
+variance = 1.25
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.036694017385370196471 0.170446566151030043379 0.313946802871486463360 \
+  0.500000000000000000000 0.524301871108091344098 0.548499642158953415461 \
+  0.596175897131692944519 0.686053197128513536640 0.829553433848969956621 \
+  0.963305982614629741079 0.993328172488715188670 0.998740833687631668347 \
+  0.999731333198621729963
+pdf.values = \
+  0.0611457663212181812273 0.2303619892291386972438 0.3396951363520777644744 \
+  0.3891083839660310905728 0.3882734691832335771622 0.3857813984229577219942 \
+  0.3760002856897183276530 0.3396951363520777644744 0.2303619892291386972438 \
+  0.0611457663212181812273 0.0114005494645425288491 0.0020310339110412166559 \
+  0.0003960010564637987977
+sf.values = \
+  0.96330598261462974107872 0.82955343384896995662103 \
+  0.68605319712851353664007 0.50000000000000000000000 \
+  0.47569812889190860039079 0.45150035784104658453941 \
+  0.40382410286830705548056 0.31394680287148646335993 \
+  0.17044656615103004337897 0.03669401738537019647124 \
+  0.00667182751128479398228 0.00125916631236834509686 \
+  0.00026866680137822623528
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.6.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.6.properties
new file mode 100644
index 0000000..22e0aee
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.6.properties
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 100.0
+# Limited by SF values
+tolerance.relative = 3e-15
+mean = 0
+variance = 1.0204081632653061
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.024106089365566834432 0.159862077892061860140 0.309086782915443336606 \
+  0.500000000000000000000 0.524855292152292651764 0.549612753423250222085 \
+  0.598449893923389764083 0.690913217084556663394 0.840137922107938139860 \
+  0.975893910634433092710 0.998296042328335353488 0.999939238177849576417 \
+  0.999998774913293253519
+pdf.values = \
+  5.4908643295409689800e-02 2.4076589692854596936e-01 \
+  3.5080283339233037099e-01 3.9794618693589384195e-01 \
+  3.9716196497428690737e-01 3.9481874210251571844e-01 \
+  3.8558595819834484697e-01 3.5080283339233037099e-01 \
+  2.4076589692854596936e-01 5.4908643295409689800e-02 \
+  5.1260897023202561112e-03 2.2115455654062911046e-04 \
+  5.0800582347272749576e-06
+sf.values = \
+  9.7589391063443309271e-01 8.4013792210793813986e-01 \
+  6.9091321708455666339e-01 5.0000000000000000000e-01 \
+  4.7514470784770734824e-01 4.5038724657674977792e-01 \
+  4.0155010607661023592e-01 3.0908678291544333661e-01 \
+  1.5986207789206186014e-01 2.4106089365566834432e-02 \
+  1.7039576716647252246e-03 6.0761822150380825143e-05 \
+  1.2250867067518980009e-06
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.7.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.7.properties
new file mode 100644
index 0000000..9213c6e
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.7.properties
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 1e4
+# Limited by SF values
+tolerance.relative = 4e-15
+mean = 0
+variance = 1.0002000400080016
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.022763630330717734424 0.158667352165214714521 0.308543039661616669278 \
+  0.500000000000000000000 0.524917044475850413932 0.549736968525204927616 \
+  0.598703757998587549061 0.691456960338383330722 0.841332647834785340990 \
+  0.977236369669282289863 0.998646775905001171658 0.999968100665588499609 \
+  0.999999708483669369485
+pdf.values = \
+  5.4000412160239041892e-02 2.4195862648700797171e-01 \
+  3.5205267468981715773e-01 3.9893230696910769728e-01 \
+  3.9815382510238345182e-01 3.9582748430212794100e-01 \
+  3.8665727967812585364e-01 3.5205267468981715773e-01 \
+  2.4195862648700797171e-01 5.4000412160239041892e-02 \
+  4.4387186123801547488e-03 1.3457758132743024041e-04 \
+  1.5081708994681568206e-06
+sf.values = \
+  9.7723636966928228986e-01 8.4133264783478534099e-01 \
+  6.9145696033838333072e-01 5.0000000000000000000e-01 \
+  4.7508295552414964158e-01 4.5026303147479507238e-01 \
+  4.0129624200141245094e-01 3.0854303966161666928e-01 \
+  1.5866735216521471452e-01 2.2763630330717734424e-02 \
+  1.3532240949988326786e-03 3.1899334411569732234e-05 \
+  2.9151633068313210561e-07
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.8.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.8.properties
new file mode 100644
index 0000000..2e212f6
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.8.properties
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 1e6
+# Limited by SF values
+tolerance.relative = 4e-15
+mean = 0
+variance = 1.000002000004
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.022750266925659592271 0.158655374916789077000 0.308537593736185833393 \
+  0.500000000000000000000 0.524917662783635718959 0.549738212266906667303 \
+  0.598706300005747316106 0.691462406263814166607 0.841344625083210950756 \
+  0.977249733074340376504 0.998650068729289186464 0.999968326482995051308 \
+  0.999999713300106396474
+pdf.values = \
+  5.3991060997102185981e-02 2.4197060353383154085e-01 \
+  3.5206520024085002918e-01 3.9894218066587505689e-01 \
+  3.9816375636979017827e-01 3.9583758491701903637e-01 \
+  3.8666800843006249311e-01 3.5206520024085002918e-01 \
+  2.4197060353383154085e-01 5.3991060997102185981e-02 \
+  4.4319171056720427920e-03 1.3383768692515205434e-04 \
+  1.4869328706530258966e-06
+sf.values = \
+  9.7724973307434037650e-01 8.4134462508321095076e-01 \
+  6.9146240626381416661e-01 5.0000000000000000000e-01 \
+  4.7508233721636428104e-01 4.5026178773309333270e-01 \
+  4.0129369999425268389e-01 3.0853759373618583339e-01 \
+  1.5865537491678907700e-01 2.2750266925659592271e-02 \
+  1.3499312707108961518e-03 3.1673517005023936119e-05 \
+  2.8669989354453675792e-07
diff --git a/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.9.properties b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.9.properties
new file mode 100644
index 0000000..55c49aa
--- /dev/null
+++ b/commons-statistics-distribution/src/test/resources/org/apache/commons/statistics/distribution/test.t.9.properties
@@ -0,0 +1,45 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+parameters = 1e10
+# Limited by SF values
+tolerance.relative = 4e-15
+mean = 0
+variance = 1.0000000002
+# computed using R
+cdf.points = \
+  -2, -1, -0.5, 0, 0.0625, 0.125, 0.25, 0.5, 1, 2, 3, 4, 5
+cdf.values = \
+  0.022750131961676897663 0.158655253943555396567 0.308537538731488258925                                                          \
+  0.500000000000000000000 0.524917669028622579930 0.549738224828856480997                                                          \
+  0.598706325680355866403 0.691462461268511741075 0.841344746056444603433                                                          \
+  0.977249868038323032948 0.998650101965045999819 0.999968328757939395324                                                          \
+  0.999999713348423302506
+pdf.values = \
+  5.3990966522636477110e-02 2.4197072450704482094e-01                                                                              \
+  3.5206532675164714519e-01 3.9894228039145912534e-01                                                                              \
+  3.9816385667685488814e-01 3.9583768693454673970e-01                                                                              \
+  3.8666811679201196217e-01 3.5206532675164714519e-01                                                                              \
+  2.4197072450704482094e-01 5.3990966522636477110e-02                                                                              \
+  4.4318484188073728469e-03 1.3383022651098887756e-04                                                                              \
+  1.4867195360687223494e-06
+sf.values = \
+  9.7724986803832303295e-01 8.4134474605644460343e-01 \
+  6.9146246126851174107e-01 5.0000000000000000000e-01 \
+  4.7508233097137742007e-01 4.5026177517114351900e-01 \
+  4.0129367431964413360e-01 3.0853753873148825893e-01 \
+  1.5865525394355539657e-01 2.2750131961676897663e-02 \
+  1.3498980349539761118e-03 3.1671242060631252789e-05 \
+  2.8665157671103194958e-07