commons-statistics.git
2 days agoRemove dependency on commons-rng-core module master
aherbert [Mon, 3 Oct 2022 11:09:59 +0000 (12:09 +0100)] 
Remove dependency on commons-rng-core module

The statistics API requires the commons-rng-client-api. The
implementation requires commons-rng-sampling. The commons-rng-core
module is not required. The dependency is imported transiently for
testing using commons-rng-simple.

2 days agoUse TSampler from commons RNG
aherbert [Mon, 3 Oct 2022 11:02:22 +0000 (12:02 +0100)] 
Use TSampler from commons RNG

2 days agoUse LogNormalSampler from commons RNG
aherbert [Mon, 3 Oct 2022 11:01:50 +0000 (12:01 +0100)] 
Use LogNormalSampler from commons RNG

2 days agoUpdate ZipfDistribution to always use RejectionInversionZipfSampler
aherbert [Mon, 3 Oct 2022 10:54:54 +0000 (11:54 +0100)] 
Update ZipfDistribution to always use RejectionInversionZipfSampler

The RejectionInversionZipfSampler was modified in release 1.5 to allow
an exponent of 0.

Change fixed seed for ZipfDistributionTest. Seed expansion from
primitive seeds has changed in RNG 1.5.

2 days agoUpdate RNG 1.4 -> 1.5-SNAPSHOT
aherbert [Mon, 3 Oct 2022 10:30:49 +0000 (11:30 +0100)] 
Update RNG 1.4 -> 1.5-SNAPSHOT

Manage dependencies using the RNG Bill of Materials

4 days agoSTATISTICS-55: TruncatedNormalDistribution sampler
Alex Herbert [Mon, 26 Sep 2022 22:48:45 +0000 (23:48 +0100)] 
STATISTICS-55: TruncatedNormalDistribution sampler

Add a sampler using rejection sampling of a standard normal deviate.

This is used when the truncation covers a set fraction of the CDF of the
parent normal distribution.

A JMH benchmark indicates that this can be conservatively set at 20%.

8 days agoUpdated truncated normal test files
Alex Herbert [Mon, 26 Sep 2022 22:25:37 +0000 (23:25 +0100)] 
Updated truncated normal test files

Add a test for a truncation completely below the mean without an
infinite bound.

10 days agoRemove javadoc links to JDK (reporting)
Alex Herbert [Sat, 24 Sep 2022 21:22:56 +0000 (22:22 +0100)] 
Remove javadoc links to JDK (reporting)

10 days agoRemove javadoc links to JDK.
Alex Herbert [Sat, 24 Sep 2022 21:20:11 +0000 (22:20 +0100)] 
Remove javadoc links to JDK.

The links configured in CP create redirect warnings on JDK 17 which fail
the build. JDK links are automatically added by the javadoc plugin based
on the target version.

2 weeks agoRemove obsolete clirr plugin
aherbert [Tue, 20 Sep 2022 12:30:40 +0000 (13:30 +0100)] 
Remove obsolete clirr plugin

4 weeks agoRefer to master branch only and drop reference to trunk branch name
Gary Gregory [Thu, 1 Sep 2022 11:55:36 +0000 (07:55 -0400)] 
Refer to master branch only and drop reference to trunk branch name

3 months agoMigrate workflows from adopt to temurin
Alex Herbert [Wed, 29 Jun 2022 22:25:58 +0000 (23:25 +0100)] 
Migrate workflows from adopt to temurin

3 months agoUse GitHub Actions setup-java Maven cache property
Alex Herbert [Wed, 29 Jun 2022 12:57:13 +0000 (13:57 +0100)] 
Use GitHub Actions setup-java Maven cache property

3 months agoRequire method javadoc for private scope
Alex Herbert [Sun, 26 Jun 2022 21:42:23 +0000 (22:42 +0100)] 
Require method javadoc for private scope

3 months agoUpdate checkstyle
Alex Herbert [Sat, 25 Jun 2022 09:44:39 +0000 (10:44 +0100)] 
Update checkstyle

plugin 3.0.0 -> 3.1.2
dependency 8.20 -> 8.45

Add missing javadoc checks

Correct use of line length check.

Allow long line length for test properties files.

Correct unnecessary parentheses.

3 months agoFail javadoc on warnings
Alex Herbert [Sat, 25 Jun 2022 09:01:46 +0000 (10:01 +0100)] 
Fail javadoc on warnings

3 months agoFail javadoc on warnings
Alex Herbert [Sat, 25 Jun 2022 08:56:20 +0000 (09:56 +0100)] 
Fail javadoc on warnings

3 months agoFail build on coverage checks
Alex Herbert [Sat, 25 Jun 2022 08:43:47 +0000 (09:43 +0100)] 
Fail build on coverage checks

3 months agoRemove block level element from inside <p> tags
Alex Herbert [Thu, 9 Jun 2022 15:29:29 +0000 (16:29 +0100)] 
Remove block level element from inside <p> tags

3 months agoRemove travis profile
aherbert [Tue, 7 Jun 2022 12:30:15 +0000 (13:30 +0100)] 
Remove travis profile

4 months agoDisable Travis CI
Alex Herbert [Sun, 5 Jun 2022 21:36:54 +0000 (22:36 +0100)] 
Disable Travis CI

4 months agoUpdate README badges
Alex Herbert [Sun, 5 Jun 2022 21:36:27 +0000 (22:36 +0100)] 
Update README badges

coveralls to codecov
travis to GH actions

4 months agoUse a single build goal
Alex Herbert [Sat, 4 Jun 2022 14:13:02 +0000 (15:13 +0100)] 
Use a single build goal

This allows the examples modules to use the dependency artifacts from
the build and not the local repository.

4 months agoSkip generated files in JMH module for checkstyle
Alex Herbert [Sun, 29 May 2022 07:28:36 +0000 (08:28 +0100)] 
Skip generated files in JMH module for checkstyle

4 months agoSkip spotbugs in JMH module
Alex Herbert [Sun, 29 May 2022 07:27:42 +0000 (08:27 +0100)] 
Skip spotbugs in JMH module

4 months agoDrop duplicate plugin configuration.
Alex Herbert [Sun, 29 May 2022 07:01:01 +0000 (08:01 +0100)] 
Drop duplicate plugin configuration.

This is inherited from the parent.

4 months agoFiles entry must be on a single line
Alex Herbert [Fri, 27 May 2022 19:09:47 +0000 (20:09 +0100)] 
Files entry must be on a single line

4 months agoExclude JMH generated files from javadoc
Alex Herbert [Fri, 27 May 2022 15:52:38 +0000 (16:52 +0100)] 
Exclude JMH generated files from javadoc

4 months agoRemove HTML header tags from javadoc
Alex Herbert [Fri, 27 May 2022 15:44:30 +0000 (16:44 +0100)] 
Remove HTML header tags from javadoc

4 months agoAdd GitHub actions workflows
Alex Herbert [Fri, 27 May 2022 15:39:15 +0000 (16:39 +0100)] 
Add GitHub actions workflows

5 months agoJavadoc
aherbert [Thu, 5 May 2022 10:02:40 +0000 (11:02 +0100)] 
Javadoc

5 months agoAvoid BigDecimal computing constants on class initialisation
aherbert [Thu, 5 May 2022 10:01:08 +0000 (11:01 +0100)] 
Avoid BigDecimal computing constants on class initialisation

The constants are precomputed and verified in a unit test.

5 months agoCorrect user guide table
aherbert [Wed, 4 May 2022 16:38:21 +0000 (17:38 +0100)] 
Correct user guide table

5 months agoSonar fix: Compute the value 2^-53 for the assertion
aherbert [Wed, 4 May 2022 16:37:41 +0000 (17:37 +0100)] 
Sonar fix: Compute the value 2^-53 for the assertion

5 months agoSonar fix: rename variable to avoid restricted identifier
aherbert [Wed, 4 May 2022 16:30:36 +0000 (17:30 +0100)] 
Sonar fix: rename variable to avoid restricted identifier

5 months agoRemove incomplete test method
aherbert [Wed, 4 May 2022 16:26:56 +0000 (17:26 +0100)] 
Remove incomplete test method

5 months agoFix malformed format string
Arturo Bernal [Sun, 17 Apr 2022 18:51:38 +0000 (20:51 +0200)] 
Fix malformed format string

5 months ago* Use lambdas. 34/head
Arturo Bernal [Sun, 17 Apr 2022 18:44:55 +0000 (20:44 +0200)] 
* Use lambdas.
* Fix javadoc.

5 months agoUse https link
aherbert [Tue, 12 Apr 2022 10:43:01 +0000 (11:43 +0100)] 
Use https link

5 months agoRemove ordered lists from inside paragraph block elements
aherbert [Tue, 12 Apr 2022 10:40:04 +0000 (11:40 +0100)] 
Remove ordered lists from inside paragraph block elements

6 months agoUpdate issue tracking guide
Alex Herbert [Sun, 6 Mar 2022 22:36:41 +0000 (22:36 +0000)] 
Update issue tracking guide

Replace reference to subversion with git.

6 months agoUpdate developer guide
Alex Herbert [Sun, 6 Mar 2022 22:33:29 +0000 (22:33 +0000)] 
Update developer guide

Remove reference to building using ant.

Remove reference to non-existent wiki.

Add sections about GitHub PRs.

Remove git config for setting core.autocrlf. The project uses a
.gitattributes file to define this setting for the text files in the
repository.

Use https links. Fix broken/outdated links.

6 months agoExpand the user guide
Alex Herbert [Sat, 5 Mar 2022 08:38:20 +0000 (08:38 +0000)] 
Expand the user guide

Create a single user guide document based on the template from Commons
Geometry.

Add more entries to the site 'User Guide' menu.

Added a simple test class to verify the code examples used in the user
guide.

7 months agoCorrect example code in the user guide
Alex Herbert [Thu, 3 Mar 2022 21:43:20 +0000 (21:43 +0000)] 
Correct example code in the user guide

7 months agoAdd skeleton site documentation for distribution module
Alex Herbert [Thu, 3 Mar 2022 21:42:56 +0000 (21:42 +0000)] 
Add skeleton site documentation for distribution module

7 months agoUpdate site.xml using Commons RNG as template
Alex Herbert [Thu, 3 Mar 2022 19:13:58 +0000 (19:13 +0000)] 
Update site.xml using Commons RNG as template

7 months agoAdd SECURITY.md
Gary Gregory [Fri, 25 Feb 2022 13:24:22 +0000 (08:24 -0500)] 
Add SECURITY.md

7 months agoAdd CODE_OF_CONDUCT.md
Gary Gregory [Fri, 25 Feb 2022 13:20:22 +0000 (08:20 -0500)] 
Add CODE_OF_CONDUCT.md

8 months agoUpdate f distribution pdf function
Alex Herbert [Sat, 29 Jan 2022 08:58:07 +0000 (08:58 +0000)] 
Update f distribution pdf function

Greater accuracy is obtained using log(pdf) than using the log
computation. However the regular pdf may have intermediate overflow with
extreme parameters when the result is finite.

Extract the pdf and logpdf computation to a single method. Try the
regular pdf and switch to the log computation when the density is
sub-normal or overflows.

8 months agoAdd sample size = 0 test case
Alex Herbert [Wed, 26 Jan 2022 19:41:25 +0000 (19:41 +0000)] 
Add sample size = 0 test case

8 months agoAdd special cases for binomial distribution PMF
Alex Herbert [Wed, 26 Jan 2022 19:41:07 +0000 (19:41 +0000)] 
Add special cases for binomial distribution PMF

When x=0 or x=n the power function can be used to evaluate the PMF to 1
ULP. This is more accurate than exp(logPMF) when the expected result is
very small.

Increased precision of reference test values.

Added specific bounds test using exact pmf computation.

Updated test tolerance from default 1e-12 to 1e-15.

Added special case tests for p=0, p=1, n=0, n=1.

Updated code to handle p=-0.0.

8 months agoReuse temp n result
Alex Herbert [Wed, 26 Jan 2022 10:00:05 +0000 (10:00 +0000)] 
Reuse temp n result

Remove invalid code comment

8 months agoFix typo
Alex Herbert [Wed, 26 Jan 2022 01:21:44 +0000 (01:21 +0000)] 
Fix typo

8 months agoUpdated PMF vs log PMF assertion at the support bound
Alex Herbert [Wed, 26 Jan 2022 01:21:30 +0000 (01:21 +0000)] 
Updated PMF vs log PMF assertion at the support bound

8 months agoTest file formatting
Alex Herbert [Tue, 25 Jan 2022 21:31:04 +0000 (21:31 +0000)] 
Test file formatting

8 months agoUpdate F distribution with the beta function
aherbert [Wed, 26 Jan 2022 18:05:11 +0000 (18:05 +0000)] 
Update F distribution with the beta function

Added second PDF form to the class javadoc.

Use the beta function following the Boost documentation for the F
distribution.

The CDF and SF can use the regularized beta or its complement. This is
chosen depending on the x argument.

The PDF can use the beta derivative using the same logic for choosing
the value passed to the derivative function.

Updated the log PDF to reduce the number of terms.

Added SF values to test files.

Large degrees of freedom data (n=100, m=100) requires a more accurate
source implementation.

8 months agoFix test javadoc
aherbert [Wed, 26 Jan 2022 14:20:33 +0000 (14:20 +0000)] 
Fix test javadoc

8 months agoAdd a t-distribution sampler
aherbert [Mon, 24 Jan 2022 12:53:10 +0000 (12:53 +0000)] 
Add a t-distribution sampler

8 months agoRemove trailing whitespace
aherbert [Mon, 24 Jan 2022 13:38:53 +0000 (13:38 +0000)] 
Remove trailing whitespace

8 months agoAdd t distribution test cases for more degrees of freedom
aherbert [Mon, 24 Jan 2022 13:37:19 +0000 (13:37 +0000)] 
Add t distribution test cases for more degrees of freedom

Add df=0.25, 0.5, 10, 1e2, 1e4, 1e6, 1e10, 1e14

8 months agoSTATISTICS-25: Use beta function for the PDF
Alex Herbert [Sun, 23 Jan 2022 22:47:06 +0000 (22:47 +0000)] 
STATISTICS-25: Use beta function for the PDF

Added PDF test data for large degrees of freedom.

8 months agoRemove RegularizedBetaUtils
Alex Herbert [Sun, 23 Jan 2022 09:13:27 +0000 (09:13 +0000)] 
Remove RegularizedBetaUtils

The complement function is provided by Commons Numbers.

8 months agoBeta distribution to use RegularizedBeta.complement function
Alex Herbert [Sun, 23 Jan 2022 09:07:57 +0000 (09:07 +0000)] 
Beta distribution to use RegularizedBeta.complement function

Lower test tolerance from 1e-14 to 8e-15.

8 months agoBeta distribution to use beta functions from Commons Numbers
Alex Herbert [Sun, 23 Jan 2022 08:28:31 +0000 (08:28 +0000)] 
Beta distribution to use beta functions from Commons Numbers

Use RegularizedBeta.derivative.

Use LogBeta in place of 3 LogGamma calls.

Test data has been updated to 17 significant figures. Test tolerance
lowered from 5e-14 to 1e-14.

8 months agoUse ParameterizedTest
Alex Herbert [Sun, 23 Jan 2022 07:14:54 +0000 (07:14 +0000)] 
Use ParameterizedTest

8 months agoSTATISTICS-25: T-dist to use the complement of the regularized beta
Alex Herbert [Sat, 22 Jan 2022 14:32:20 +0000 (14:32 +0000)] 
STATISTICS-25: T-dist to use the complement of the regularized beta

NUMBERS-181 improved the regularized beta function. This allows
increasing the threshold for switching to the normal approximation.

8 months agoDrop redundant test.
Alex Herbert [Sat, 22 Jan 2022 09:37:10 +0000 (09:37 +0000)] 
Drop redundant test.

8 months agoRemove checkedProbability method from the inverse
aherbert [Fri, 21 Jan 2022 16:59:10 +0000 (16:59 +0000)] 
Remove checkedProbability method from the inverse

This method is only of use for bug reporting extremely an unlikely
event. It will negatively impact performance for all distributions
during computation of the inverse.

The extreme bounds of discrete distributions are tested in unit tests.
Any distributions where NaN values are potentially expected (e.g. zero
divide by zero; infinity - infinity) should use units tests to check
extreme parameterisations.

8 months agoRemove HTML for the PDF/CDF in the javadoc
aherbert [Fri, 21 Jan 2022 16:42:45 +0000 (16:42 +0000)] 
Remove HTML for the PDF/CDF in the javadoc

The PDF is defined in the class header using mathjax.

No CDFs are defined for any distribution and removing this is more
consistent with the current javadoc.

8 months agoConsistent javadoc for property getters
aherbert [Fri, 21 Jan 2022 16:37:18 +0000 (16:37 +0000)] 
Consistent javadoc for property getters

Use 'Gets the X parameter of this distribution'.

Removes the use of 'Access the X parameter' for some of the javadocs.
Using 'Gets' matches the same usage in the interface for the mean,
variance and lower/upper bounds.

Removes the use of parameter names within @code tags unless these are
defined in the same javadoc, e.g. LogNormalDistribution mu parameter.

8 months agoSTATISTICS-52: Add a high precision PDF to the normal distribution
aherbert [Fri, 21 Jan 2022 15:01:00 +0000 (15:01 +0000)] 
STATISTICS-52: Add a high precision PDF to the normal distribution

Exploit information in the round-off from x*x to increase the precision
of exp(-0.5*x*x) when x is large.

Add a benchmark to demonstrate this has minor impact on the runtime
performance. Accuracy is increased to within 3 ULP (down from hundreds)
for large x values.

8 months agoFix maxima script to generated normpdf.csv
aherbert [Mon, 17 Jan 2022 15:38:38 +0000 (15:38 +0000)] 
Fix maxima script to generated normpdf.csv

The constant for sqrt(2*pi) was not correctly declared as a big float.

The regenerated data is different from the 17th significant figure.

9 months agoUpdate NOTICE to 2022
Alex Herbert [Mon, 3 Jan 2022 22:00:11 +0000 (22:00 +0000)] 
Update NOTICE to 2022

9 months agoAdd second reference data for additional moments
Alex Herbert [Mon, 3 Jan 2022 21:57:33 +0000 (21:57 +0000)] 
Add second reference data for additional moments

Update computation of variance to avoid the use of the mean squared.
This avoids loss of precision in (omega/mu) by not having to square the
sqrt(omega/mu).

9 months agoIncrease Exponential PDF test tolerance
Alex Herbert [Fri, 24 Dec 2021 15:08:39 +0000 (15:08 +0000)] 
Increase Exponential PDF test tolerance

The Math.exp function is platform dependent and has lower accuracy than
1 ULP on the given test data depending on the JDK and OS.

9 months agoJavadoc parameter range for mu
Alex Herbert [Fri, 24 Dec 2021 14:36:09 +0000 (14:36 +0000)] 
Javadoc parameter range for mu

9 months agoSample Nakagami using a related gamma distribution
Alex Herbert [Fri, 24 Dec 2021 14:29:14 +0000 (14:29 +0000)] 
Sample Nakagami using a related gamma distribution

9 months agoUpdate to use GammaRatio to compute the moments
Alex Herbert [Fri, 24 Dec 2021 14:23:53 +0000 (14:23 +0000)] 
Update to use GammaRatio to compute the moments

Added additional test cases added where the simple computation of
gamma(mu + 0.5) / gamma(mu) will overflow the gamma function.

9 months agoCache mean and variance for the inverse probability implementation
Alex Herbert [Tue, 21 Dec 2021 12:26:25 +0000 (12:26 +0000)] 
Cache mean and variance for the inverse probability implementation

9 months agoJavadoc mean and variance using abstract methods
Alex Herbert [Mon, 20 Dec 2021 22:22:30 +0000 (22:22 +0000)] 
Javadoc mean and variance using abstract methods

9 months agoSTATISTICS-36: Update accuracy of inverse probability function
Alex Herbert [Mon, 20 Dec 2021 22:15:43 +0000 (22:15 +0000)] 
STATISTICS-36: Update accuracy of inverse probability function

Changed the accuracy tolerances used by the BrentSolver. Inversion
should be accurate to close to 1 ULP.

Update test tolerances for the following distributions using the default
inverse probability method:

Beta
ChiSquared
F
Gamma
Nakagami
T

Fix the Beta distribution sampling test. Extreme parameterisations
cannot be sampled using uniform expected bins due to low precision of
values close to 1.

More accurate test tolerances required:

- SF values to be added for beta, chi-squared, gamma and t
distributions.
- Log density for F distribution test.
- Extended precision of the test data for Nakagami(1.5, 2) including SF
values.
- Updated T distribution test for infinite degrees of freedom. The
normal distribution from matlab more closely agrees with the current
implementation than scipy or R.

9 months agoAdd JMH benchmarking module
Alex Herbert [Mon, 20 Dec 2021 09:55:28 +0000 (09:55 +0000)] 
Add JMH benchmarking module

Add benchmark for distribution inverse probability functions.

9 months agoRemove redundant licenses from LICENSE
Alex Herbert [Sun, 19 Dec 2021 13:01:24 +0000 (13:01 +0000)] 
Remove redundant licenses from LICENSE

The RNG components do not apply in statistics.

9 months agoConsistent javadoc for the lower/upper bounds/mean/variance
Alex Herbert [Fri, 17 Dec 2021 21:41:08 +0000 (21:41 +0000)] 
Consistent javadoc for the lower/upper bounds/mean/variance

If the bounds are defined for all parameters then put this value in the
return statement.

9 months agoUpdate javadoc for mean and variance
Alex Herbert [Fri, 17 Dec 2021 20:31:25 +0000 (20:31 +0000)] 
Update javadoc for mean and variance

Remove the statement 'or {@code Double.NaN} if it is not defined'.

This only applies to a few distributions. These distributions have been
updated to state they return NaN if the mean/variance is undefined.

This change prevents all distributions inheriting the javadoc and having
to override the return tag to state the mean/variance is finite.

9 months agoCreate consistent web links in distribution class javadoc.
Alex Herbert [Fri, 17 Dec 2021 19:26:14 +0000 (19:26 +0000)] 
Create consistent web links in distribution class javadoc.

Update web links to https where applicable.

9 months agoUpdate exponential distribution PDF
Alex Herbert [Fri, 17 Dec 2021 00:50:14 +0000 (00:50 +0000)] 
Update exponential distribution PDF

Directly implement the PDF using exp and do not use exp(logDensity(x)).
This is more accurate on extended precision test data.

Remove check that x >= +infinity in the log density. The result is the
same (-infinity) without this edge case check.

9 months agoAdd PDF and PMF to distribution class javadoc
Alex Herbert [Wed, 15 Dec 2021 22:36:15 +0000 (22:36 +0000)] 
Add PDF and PMF to distribution class javadoc

9 months agoCorrect javadoc for isSupportConnected
aherbert [Thu, 16 Dec 2021 12:18:46 +0000 (12:18 +0000)] 
Correct javadoc for isSupportConnected

9 months agoReduce isSupportConnected to package-private
aherbert [Thu, 16 Dec 2021 12:16:30 +0000 (12:16 +0000)] 
Reduce isSupportConnected to package-private

It is a package level implementation detail.

9 months agoReduce getMedian to package-private
aherbert [Thu, 16 Dec 2021 11:44:49 +0000 (11:44 +0000)] 
Reduce getMedian to package-private

If protected this is exposed in javadoc. It is a package level
implementation detail.

9 months agoAvoid overflow in the continuous uniform distribution
aherbert [Thu, 16 Dec 2021 11:18:25 +0000 (11:18 +0000)] 
Avoid overflow in the continuous uniform distribution

The range (upper - lower) must be finite for the current implementation
to function. If infinite (or nan) then throw an exception.

Ensure the mean is robust to overflow if (lower + upper) is infinite.

9 months agoPMD fix: Refactor adjustment of infinite bounds to methods
aherbert [Thu, 16 Dec 2021 12:12:54 +0000 (12:12 +0000)] 
PMD fix: Refactor adjustment of infinite bounds to methods

This reduces complexity in the inverseProbability method

9 months agoEnsure default inverse probability is robust to distribution truncation
aherbert [Thu, 16 Dec 2021 10:53:22 +0000 (10:53 +0000)] 
Ensure default inverse probability is robust to distribution truncation

This was discovered as the F-distribution with numerator DF=1 and
denominator DF=2 computed a survival probability:

sf(infinity) = 0.0
sf(max_value) = 5.56e-309

If the inverse SF was called with a p-value lower than 5.56e-309 (e.g.
Double.MIN_VALUE) the required value of x is outside the finite range of
a double.

9 months agoFix typo
aherbert [Wed, 15 Dec 2021 17:44:03 +0000 (17:44 +0000)] 
Fix typo

9 months agoChange survival to sf in the distribution examples application
aherbert [Wed, 15 Dec 2021 17:17:46 +0000 (17:17 +0000)] 
Change survival to sf in the distribution examples application

9 months agoRemoved redundant tolerance from beta distribution test files
aherbert [Wed, 15 Dec 2021 17:03:42 +0000 (17:03 +0000)] 
Removed redundant tolerance from beta distribution test files

The tests pass using the global tolerance for the beta distribution.

Accuracy of the RegularisedBeta function used for the CDF and SF may
have been improved by changes to the gamma functions in [NUMBERS-174].

9 months agoSTATISTICS-39: Update chisq distribution tests
Alex Herbert [Mon, 13 Dec 2021 23:14:43 +0000 (23:14 +0000)] 
STATISTICS-39: Update chisq distribution tests

The gamma distribution density function was fixed for small shape
values. This fixes the known failing tests for the chi-squared
distribution.

This requires a change to the BaseContinuousDistributionTest to exclude
extremely steep density integrals.

9 months agoSTATISTICS-39: Update Gamma distribution to use Number's gamma
Alex Herbert [Mon, 13 Dec 2021 20:34:44 +0000 (20:34 +0000)] 
STATISTICS-39: Update Gamma distribution to use Number's gamma

The PDF is computed using RegularizedGamma.P.derivative.

Additional test data added for shape 0.25, 0.5, 0.75.

Existing PDF test tolerances lowered where improvements have been made.

Reinstate disabled test of a very small shape parameter.

9 months agoUpdate test tolerances.
Alex Herbert [Sat, 11 Dec 2021 08:43:29 +0000 (08:43 +0000)] 
Update test tolerances.

The updated gamma function introduced by NUMBERS-174 improves the
accuracy of the Poisson distribution. Values for very large mean for the
CDF and SF agree with the R implementation to 1e-14 relative error. This
improves from the previous gamma function which required 1e-5 relative
error.