From 09b2b89c289fcc8319f03f74cc6e7756fde70963 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 20:30:24 +0100 Subject: [PATCH 01/12] Replace Math-Core-Distribution into Math-Distributions --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 6 +++--- src/Math-Core-Distribution/package.st | 1 - .../PMCongruentialRandomNumberGenerator.class.st | 2 +- .../PMErfApproximation.class.st | 2 +- .../PMMitchellMooreGenerator.class.st | 2 +- .../PMMultivariateNormalDistribution.class.st | 2 +- .../PMNormalDistribution.class.st | 2 +- .../PMProbabilityDensity.class.st | 2 +- src/Math-Distributions/package.st | 1 + src/Math-Tests-Core-Distribution/package.st | 1 - .../PMMultivariateNormalDistributionTest.class.st | 2 +- src/Math-Tests-Distributions/package.st | 1 + 12 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 src/Math-Core-Distribution/package.st rename src/{Math-Core-Distribution => Math-Distributions}/PMCongruentialRandomNumberGenerator.class.st (98%) rename src/{Math-Core-Distribution => Math-Distributions}/PMErfApproximation.class.st (98%) rename src/{Math-Core-Distribution => Math-Distributions}/PMMitchellMooreGenerator.class.st (98%) rename src/{Math-Core-Distribution => Math-Distributions}/PMMultivariateNormalDistribution.class.st (98%) rename src/{Math-Core-Distribution => Math-Distributions}/PMNormalDistribution.class.st (98%) rename src/{Math-Core-Distribution => Math-Distributions}/PMProbabilityDensity.class.st (99%) create mode 100644 src/Math-Distributions/package.st delete mode 100644 src/Math-Tests-Core-Distribution/package.st rename src/{Math-Tests-Core-Distribution => Math-Tests-Distributions}/PMMultivariateNormalDistributionTest.class.st (97%) create mode 100644 src/Math-Tests-Distributions/package.st diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index 74732584a..466cfac09 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -45,10 +45,10 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Complex' with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Helpers'; - package: 'Math-Core-Distribution' with: [ spec requires: #('PolyMathDataStructures') ]; + package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; - package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Core-Distribution' 'Math-DistributionGamma' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; - package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Core-Distribution' 'Math-DistributionGamma' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; + package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionGamma' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; + package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionGamma' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-DistributionBeta' with: [ spec requires: #('Math-DistributionGamma') ]; package: 'Math-DistributionForHistogram' diff --git a/src/Math-Core-Distribution/package.st b/src/Math-Core-Distribution/package.st deleted file mode 100644 index 789d40f1f..000000000 --- a/src/Math-Core-Distribution/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-Core-Distribution' } diff --git a/src/Math-Core-Distribution/PMCongruentialRandomNumberGenerator.class.st b/src/Math-Distributions/PMCongruentialRandomNumberGenerator.class.st similarity index 98% rename from src/Math-Core-Distribution/PMCongruentialRandomNumberGenerator.class.st rename to src/Math-Distributions/PMCongruentialRandomNumberGenerator.class.st index aecbfc6bf..ba54324e2 100644 --- a/src/Math-Core-Distribution/PMCongruentialRandomNumberGenerator.class.st +++ b/src/Math-Distributions/PMCongruentialRandomNumberGenerator.class.st @@ -10,7 +10,7 @@ Class { #classVars : [ 'UniqueInstance' ], - #category : 'Math-Core-Distribution' + #category : #'Math-Distributions' } { #category : #creation } diff --git a/src/Math-Core-Distribution/PMErfApproximation.class.st b/src/Math-Distributions/PMErfApproximation.class.st similarity index 98% rename from src/Math-Core-Distribution/PMErfApproximation.class.st rename to src/Math-Distributions/PMErfApproximation.class.st index 98fa142cc..93baa51bb 100644 --- a/src/Math-Core-Distribution/PMErfApproximation.class.st +++ b/src/Math-Distributions/PMErfApproximation.class.st @@ -40,7 +40,7 @@ Class { #classVars : [ 'UniqueInstance' ], - #category : #'Math-Core-Distribution' + #category : #'Math-Distributions-Core' } { #category : #creation } diff --git a/src/Math-Core-Distribution/PMMitchellMooreGenerator.class.st b/src/Math-Distributions/PMMitchellMooreGenerator.class.st similarity index 98% rename from src/Math-Core-Distribution/PMMitchellMooreGenerator.class.st rename to src/Math-Distributions/PMMitchellMooreGenerator.class.st index fdee987b6..90ead562c 100644 --- a/src/Math-Core-Distribution/PMMitchellMooreGenerator.class.st +++ b/src/Math-Distributions/PMMitchellMooreGenerator.class.st @@ -9,7 +9,7 @@ Class { #classVars : [ 'UniqueInstance' ], - #category : #'Math-Core-Distribution' + #category : #'Math-Distributions' } { #category : #creation } diff --git a/src/Math-Core-Distribution/PMMultivariateNormalDistribution.class.st b/src/Math-Distributions/PMMultivariateNormalDistribution.class.st similarity index 98% rename from src/Math-Core-Distribution/PMMultivariateNormalDistribution.class.st rename to src/Math-Distributions/PMMultivariateNormalDistribution.class.st index 184653a3a..fca627b97 100644 --- a/src/Math-Core-Distribution/PMMultivariateNormalDistribution.class.st +++ b/src/Math-Distributions/PMMultivariateNormalDistribution.class.st @@ -5,7 +5,7 @@ Class { 'meanVector', 'covarianceMatrix' ], - #category : #'Math-Core-Distribution' + #category : #'Math-Distributions-Normal' } { #category : #'instance creation' } diff --git a/src/Math-Core-Distribution/PMNormalDistribution.class.st b/src/Math-Distributions/PMNormalDistribution.class.st similarity index 98% rename from src/Math-Core-Distribution/PMNormalDistribution.class.st rename to src/Math-Distributions/PMNormalDistribution.class.st index b37fedf81..7e7e4f080 100644 --- a/src/Math-Core-Distribution/PMNormalDistribution.class.st +++ b/src/Math-Distributions/PMNormalDistribution.class.st @@ -8,7 +8,7 @@ Class { #classVars : [ 'NextRandom' ], - #category : #'Math-Core-Distribution' + #category : #'Math-Distributions-Normal' } { #category : #information } diff --git a/src/Math-Core-Distribution/PMProbabilityDensity.class.st b/src/Math-Distributions/PMProbabilityDensity.class.st similarity index 99% rename from src/Math-Core-Distribution/PMProbabilityDensity.class.st rename to src/Math-Distributions/PMProbabilityDensity.class.st index b401aea4c..001a3c05f 100644 --- a/src/Math-Core-Distribution/PMProbabilityDensity.class.st +++ b/src/Math-Distributions/PMProbabilityDensity.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'flatGenerator' ], - #category : #'Math-Core-Distribution' + #category : #'Math-Distributions-Core' } { #category : #information } diff --git a/src/Math-Distributions/package.st b/src/Math-Distributions/package.st new file mode 100644 index 000000000..fecc5924c --- /dev/null +++ b/src/Math-Distributions/package.st @@ -0,0 +1 @@ +Package { #name : #'Math-Distributions' } diff --git a/src/Math-Tests-Core-Distribution/package.st b/src/Math-Tests-Core-Distribution/package.st deleted file mode 100644 index b19b2cef0..000000000 --- a/src/Math-Tests-Core-Distribution/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-Tests-Core-Distribution' } diff --git a/src/Math-Tests-Core-Distribution/PMMultivariateNormalDistributionTest.class.st b/src/Math-Tests-Distributions/PMMultivariateNormalDistributionTest.class.st similarity index 97% rename from src/Math-Tests-Core-Distribution/PMMultivariateNormalDistributionTest.class.st rename to src/Math-Tests-Distributions/PMMultivariateNormalDistributionTest.class.st index c095ee240..66f673e8b 100644 --- a/src/Math-Tests-Core-Distribution/PMMultivariateNormalDistributionTest.class.st +++ b/src/Math-Tests-Distributions/PMMultivariateNormalDistributionTest.class.st @@ -6,7 +6,7 @@ Class { 'covarianceMatrix', 'distribution' ], - #category : #'Math-Tests-Core-Distribution' + #category : #'Math-Tests-Distributions-Normal' } { #category : #running } diff --git a/src/Math-Tests-Distributions/package.st b/src/Math-Tests-Distributions/package.st new file mode 100644 index 000000000..9f0927443 --- /dev/null +++ b/src/Math-Tests-Distributions/package.st @@ -0,0 +1 @@ +Package { #name : #'Math-Tests-Distributions' } From 1b5c914ae3d8aa8b66b2af1dae61b47a1b630843 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 20:31:50 +0100 Subject: [PATCH 02/12] Fix baseline --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index 466cfac09..42bb717af 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -52,9 +52,9 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-DistributionBeta' with: [ spec requires: #('Math-DistributionGamma') ]; package: 'Math-DistributionForHistogram' - with: [ spec requires: #('Math-Core-Distribution') ]; + with: [ spec requires: #('Math-Distributions') ]; package: 'Math-DistributionGamma' - with: [ spec requires: #('Math-Core-Distribution') ]; + with: [ spec requires: #('Math-Distributions') ]; package: 'Math-FastFourierTransform' with: [ spec requires: #('Math-Complex') ]; package: 'Math-FunctionFit' @@ -83,11 +83,11 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Tests-ArbitraryPrecisionFloat' with: [ spec requires: #('Math-ArbitraryPrecisionFloat') ]; package: 'Math-Tests-AutomaticDifferenciation' with: [ spec requires: #('Math-AutomaticDifferenciation' 'PolyMathDataStructures') ]; - package: 'Math-Tests-Clustering' with: [ spec requires: #('Math-Clustering' 'Math-Core-Distribution' 'Math-UtilsDataServer') ]; + package: 'Math-Tests-Clustering' with: [ spec requires: #('Math-Clustering' 'Math-Distributions' 'Math-UtilsDataServer') ]; package: 'Math-Tests-Complex' with: [ spec requires: #('Math-Complex') ]; - package: 'Math-Tests-Core-Distribution' - with: [ spec requires: #('Math-Core-Distribution') ]; + package: 'Math-Tests-Distributions' + with: [ spec requires: #('Math-Distributions') ]; package: 'Math-Tests-Core-Process' with: [ spec requires: #('Math-Core-Process') ]; package: 'Math-Tests-Numerical' @@ -128,13 +128,13 @@ BaselineOfPolyMath >> baseline: spec [ with: #('Math-Benchmarks-ODE' 'Math-Benchmarks-KDTree'); group: 'Core' with: - #('Math-Complex' 'Math-Quaternion' 'Math-Numerical' 'Math-Random' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat' 'Math-FastFourierTransform' 'ExtendedNumberParser' 'Math-Quantile' 'Math-Physics-Constants' 'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process' 'Math-Helpers' 'PolyMathDataStructures' 'Math-Core-Distribution'); + #('Math-Complex' 'Math-Quaternion' 'Math-Numerical' 'Math-Random' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat' 'Math-FastFourierTransform' 'ExtendedNumberParser' 'Math-Quantile' 'Math-Physics-Constants' 'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process' 'Math-Helpers' 'PolyMathDataStructures' 'Math-Distributions'); group: 'Extensions' with: #('Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-KernelSmoothing' 'Math-Permutation' 'Math-KolmogorovSmirnov'); group: 'Tests' with: - #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-KolmogorovSmirnov' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Core-Distribution'); + #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-KolmogorovSmirnov' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions'); group: 'default' with: #('Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy') ]. From 08181af2a4c08cba20b38df998f2491150ac62cf Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 20:57:20 +0100 Subject: [PATCH 03/12] Merge Distribution Gamma --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 8 +++----- src/Math-DistributionGamma/package.st | 1 - .../PMAsymptoticChiSquareDistribution.class.st | 2 +- .../PMChiSquareDistribution.class.st | 2 +- .../PMGammaDistribution.class.st | 2 +- .../PMIncompleteGammaFunction.class.st | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 src/Math-DistributionGamma/package.st rename src/{Math-DistributionGamma => Math-Distributions}/PMAsymptoticChiSquareDistribution.class.st (98%) rename src/{Math-DistributionGamma => Math-Distributions}/PMChiSquareDistribution.class.st (97%) rename src/{Math-DistributionGamma => Math-Distributions}/PMGammaDistribution.class.st (99%) rename src/{Math-DistributionGamma => Math-Distributions}/PMIncompleteGammaFunction.class.st (97%) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index 42bb717af..a3e3b586a 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -47,13 +47,11 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Helpers'; package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; - package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionGamma' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; - package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionGamma' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; + package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; + package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-DistributionBeta' - with: [ spec requires: #('Math-DistributionGamma') ]; - package: 'Math-DistributionForHistogram' with: [ spec requires: #('Math-Distributions') ]; - package: 'Math-DistributionGamma' + package: 'Math-DistributionForHistogram' with: [ spec requires: #('Math-Distributions') ]; package: 'Math-FastFourierTransform' with: [ spec requires: #('Math-Complex') ]; diff --git a/src/Math-DistributionGamma/package.st b/src/Math-DistributionGamma/package.st deleted file mode 100644 index 32e797296..000000000 --- a/src/Math-DistributionGamma/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-DistributionGamma' } diff --git a/src/Math-DistributionGamma/PMAsymptoticChiSquareDistribution.class.st b/src/Math-Distributions/PMAsymptoticChiSquareDistribution.class.st similarity index 98% rename from src/Math-DistributionGamma/PMAsymptoticChiSquareDistribution.class.st rename to src/Math-Distributions/PMAsymptoticChiSquareDistribution.class.st index e0d08cc51..f7d56f83a 100644 --- a/src/Math-DistributionGamma/PMAsymptoticChiSquareDistribution.class.st +++ b/src/Math-Distributions/PMAsymptoticChiSquareDistribution.class.st @@ -6,7 +6,7 @@ Class { 'reducedDOF', 'normalDistribution' ], - #category : 'Math-DistributionGamma' + #category : #'Math-Distributions-Gamma' } { #category : #creation } diff --git a/src/Math-DistributionGamma/PMChiSquareDistribution.class.st b/src/Math-Distributions/PMChiSquareDistribution.class.st similarity index 97% rename from src/Math-DistributionGamma/PMChiSquareDistribution.class.st rename to src/Math-Distributions/PMChiSquareDistribution.class.st index ce743ddf5..587a5f7c6 100644 --- a/src/Math-DistributionGamma/PMChiSquareDistribution.class.st +++ b/src/Math-Distributions/PMChiSquareDistribution.class.st @@ -1,7 +1,7 @@ Class { #name : #PMChiSquareDistribution, #superclass : #PMGammaDistribution, - #category : 'Math-DistributionGamma' + #category : #'Math-Distributions-Gamma' } { #category : #creation } diff --git a/src/Math-DistributionGamma/PMGammaDistribution.class.st b/src/Math-Distributions/PMGammaDistribution.class.st similarity index 99% rename from src/Math-DistributionGamma/PMGammaDistribution.class.st rename to src/Math-Distributions/PMGammaDistribution.class.st index f88c0486a..e87269126 100644 --- a/src/Math-DistributionGamma/PMGammaDistribution.class.st +++ b/src/Math-Distributions/PMGammaDistribution.class.st @@ -8,7 +8,7 @@ Class { 'randomCoefficients', 'incompleteGammaFunction' ], - #category : 'Math-DistributionGamma' + #category : #'Math-Distributions-Gamma' } { #category : #information } diff --git a/src/Math-DistributionGamma/PMIncompleteGammaFunction.class.st b/src/Math-Distributions/PMIncompleteGammaFunction.class.st similarity index 97% rename from src/Math-DistributionGamma/PMIncompleteGammaFunction.class.st rename to src/Math-Distributions/PMIncompleteGammaFunction.class.st index 0ee6188db..321b11e42 100644 --- a/src/Math-DistributionGamma/PMIncompleteGammaFunction.class.st +++ b/src/Math-Distributions/PMIncompleteGammaFunction.class.st @@ -7,7 +7,7 @@ Class { 'series', 'fraction' ], - #category : 'Math-DistributionGamma' + #category : #'Math-Distributions-Gamma' } { #category : #creation } From 445654e8e6b9c5f16185c9ba3c5d8dd870ee5c8c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:00:58 +0100 Subject: [PATCH 04/12] Merge distribution beta --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 6 ++---- src/Math-DistributionBeta/package.st | 1 - .../PMBetaDistribution.class.st | 2 +- .../PMIncompleteBetaFunction.class.st | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 src/Math-DistributionBeta/package.st rename src/{Math-DistributionBeta => Math-Distributions}/PMBetaDistribution.class.st (99%) rename src/{Math-DistributionBeta => Math-Distributions}/PMIncompleteBetaFunction.class.st (98%) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index a3e3b586a..03a87b15a 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -47,10 +47,8 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Helpers'; package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; - package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; - package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionBeta' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; - package: 'Math-DistributionBeta' - with: [ spec requires: #('Math-Distributions') ]; + package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; + package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-DistributionForHistogram' with: [ spec requires: #('Math-Distributions') ]; package: 'Math-FastFourierTransform' diff --git a/src/Math-DistributionBeta/package.st b/src/Math-DistributionBeta/package.st deleted file mode 100644 index d732810c5..000000000 --- a/src/Math-DistributionBeta/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-DistributionBeta' } diff --git a/src/Math-DistributionBeta/PMBetaDistribution.class.st b/src/Math-Distributions/PMBetaDistribution.class.st similarity index 99% rename from src/Math-DistributionBeta/PMBetaDistribution.class.st rename to src/Math-Distributions/PMBetaDistribution.class.st index abb77b346..c08c58f38 100644 --- a/src/Math-DistributionBeta/PMBetaDistribution.class.st +++ b/src/Math-Distributions/PMBetaDistribution.class.st @@ -9,7 +9,7 @@ Class { 'logNorm', 'incompleteBetaFunction' ], - #category : 'Math-DistributionBeta' + #category : #'Math-Distributions-Beta' } { #category : #information } diff --git a/src/Math-DistributionBeta/PMIncompleteBetaFunction.class.st b/src/Math-Distributions/PMIncompleteBetaFunction.class.st similarity index 98% rename from src/Math-DistributionBeta/PMIncompleteBetaFunction.class.st rename to src/Math-Distributions/PMIncompleteBetaFunction.class.st index 155d131a3..6e28d3f5e 100644 --- a/src/Math-DistributionBeta/PMIncompleteBetaFunction.class.st +++ b/src/Math-Distributions/PMIncompleteBetaFunction.class.st @@ -8,7 +8,7 @@ Class { 'inverseFraction', 'logNorm' ], - #category : 'Math-DistributionBeta' + #category : #'Math-Distributions-Beta' } { #category : #creation } From fd072e435d660391be0feab7a2aa7dc2efec8606 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:07:09 +0100 Subject: [PATCH 05/12] Merge distribution for histogram --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 8 +++----- src/Math-DistributionForHistogram/package.st | 1 - .../PMFisherSnedecorDistribution.class.st | 2 +- .../PMStudentDistribution.class.st | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 src/Math-DistributionForHistogram/package.st rename src/{Math-DistributionForHistogram => Math-Distributions}/PMFisherSnedecorDistribution.class.st (99%) rename src/{Math-DistributionForHistogram => Math-Distributions}/PMStudentDistribution.class.st (99%) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index 03a87b15a..43831786b 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -47,10 +47,8 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Helpers'; package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; - package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; - package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-DistributionForHistogram' 'Math-StatisticalMoments' 'Math-Series') ]; - package: 'Math-DistributionForHistogram' - with: [ spec requires: #('Math-Distributions') ]; + package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; + package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-FastFourierTransform' with: [ spec requires: #('Math-Complex') ]; package: 'Math-FunctionFit' @@ -72,7 +70,7 @@ BaselineOfPolyMath >> baseline: spec [ [ spec requires: #('Math-Complex' 'Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Random'; package: 'Math-Series'; - package: 'Math-StatisticalMoments' with: [ spec requires: #('Math-Helpers' 'Math-DistributionForHistogram') ]; + package: 'Math-StatisticalMoments' with: [ spec requires: #('Math-Helpers' 'Math-Distributions') ]; package: 'Math-TSNE'; package: 'Math-Tests-Accuracy' with: [ spec requires: #('Math-Accuracy-Core') ]; diff --git a/src/Math-DistributionForHistogram/package.st b/src/Math-DistributionForHistogram/package.st deleted file mode 100644 index a725388d1..000000000 --- a/src/Math-DistributionForHistogram/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-DistributionForHistogram' } diff --git a/src/Math-DistributionForHistogram/PMFisherSnedecorDistribution.class.st b/src/Math-Distributions/PMFisherSnedecorDistribution.class.st similarity index 99% rename from src/Math-DistributionForHistogram/PMFisherSnedecorDistribution.class.st rename to src/Math-Distributions/PMFisherSnedecorDistribution.class.st index de3d56465..c098d8655 100644 --- a/src/Math-DistributionForHistogram/PMFisherSnedecorDistribution.class.st +++ b/src/Math-Distributions/PMFisherSnedecorDistribution.class.st @@ -9,7 +9,7 @@ Class { 'chiSquareDistribution2', 'incompleteBetaFunction' ], - #category : 'Math-DistributionForHistogram' + #category : #'Math-Distributions-ForHistogram' } { #category : #creation } diff --git a/src/Math-DistributionForHistogram/PMStudentDistribution.class.st b/src/Math-Distributions/PMStudentDistribution.class.st similarity index 99% rename from src/Math-DistributionForHistogram/PMStudentDistribution.class.st rename to src/Math-Distributions/PMStudentDistribution.class.st index 75c63de21..faa82ecb7 100644 --- a/src/Math-DistributionForHistogram/PMStudentDistribution.class.st +++ b/src/Math-Distributions/PMStudentDistribution.class.st @@ -7,7 +7,7 @@ Class { 'chiSquareDistribution', 'incompleteBetaFunction' ], - #category : 'Math-DistributionForHistogram' + #category : #'Math-Distributions-ForHistogram' } { #category : #creation } From 8905a340a9a08d6c396dc74e568f419c940958e5 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:12:55 +0100 Subject: [PATCH 06/12] Merge distribution Kalmogorov smirnof --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 11 +++-------- .../ManifestMathDistributions.class.st | 8 ++++++++ .../PMKolmogorovsDistribution.class.st | 2 +- src/Math-KolmogorovSmirnov/package.st | 1 - .../PMKolmogorovSmirnov1Sample.class.st | 2 +- .../PMKolmogorovSmirnov1SampleTest.class.st | 2 +- .../PMKolmogorovSmirnov2Sample.class.st | 2 +- .../PMKolmogorovSmirnov2SampleTest.class.st | 2 +- .../PMKolmogorovSmirnovSample.class.st | 2 +- .../PMKolmogorovsDistributionTest.class.st | 2 +- src/Math-Tests-KolmogorovSmirnov/package.st | 1 - 11 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 src/Math-Distributions/ManifestMathDistributions.class.st rename src/{Math-KolmogorovSmirnov => Math-Distributions}/PMKolmogorovsDistribution.class.st (97%) delete mode 100644 src/Math-KolmogorovSmirnov/package.st rename src/{Math-KolmogorovSmirnov => Math-Tests-Distributions}/PMKolmogorovSmirnov1Sample.class.st (98%) rename src/{Math-Tests-KolmogorovSmirnov => Math-Tests-Distributions}/PMKolmogorovSmirnov1SampleTest.class.st (97%) rename src/{Math-KolmogorovSmirnov => Math-Tests-Distributions}/PMKolmogorovSmirnov2Sample.class.st (98%) rename src/{Math-Tests-KolmogorovSmirnov => Math-Tests-Distributions}/PMKolmogorovSmirnov2SampleTest.class.st (97%) rename src/{Math-KolmogorovSmirnov => Math-Tests-Distributions}/PMKolmogorovSmirnovSample.class.st (94%) rename src/{Math-Tests-KolmogorovSmirnov => Math-Tests-Distributions}/PMKolmogorovsDistributionTest.class.st (97%) delete mode 100644 src/Math-Tests-KolmogorovSmirnov/package.st diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index 43831786b..8d59c9dbc 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -45,7 +45,7 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Complex' with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Helpers'; - package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures') ]; + package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; @@ -57,8 +57,6 @@ BaselineOfPolyMath >> baseline: spec [ #('Math-Numerical' 'Math-Chromosome' 'Math-Accuracy-Core' 'PolyMathDataStructures' 'Math-Helpers' 'Math-Polynomials') ]; package: 'Math-KDTree'; package: 'Math-KernelSmoothing' with: [ spec requires: #('Math-Quantile' 'Math-Numerical' 'Math-Polynomials') ]; - package: 'Math-KolmogorovSmirnov' - with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Number-Extensions'; package: 'Math-ODE' with: [ spec requires: #('Math-Numerical' 'PolyMathDataStructures' 'Math-Polynomials') ]; package: 'Math-Permutation' with: [ spec requires: #('PolyMathDataStructures' 'Math-Core-Process') ]; @@ -94,9 +92,6 @@ BaselineOfPolyMath >> baseline: spec [ with: [ spec requires: #('Math-KDTree') ]; package: 'Math-Tests-KernelSmoothing' with: [ spec requires: #('Math-KernelSmoothing') ]; - package: 'Math-Tests-KolmogorovSmirnov' - with: [ spec - requires: #('Math-Numerical' 'Math-KolmogorovSmirnov' 'Math-Polynomials') ]; package: 'Math-Tests-Number-Extensions' with: [ spec requires: #('Math-Number-Extensions') ]; package: 'Math-Tests-ODE' with: [ spec requires: #('Math-ODE') ]; @@ -125,10 +120,10 @@ BaselineOfPolyMath >> baseline: spec [ #('Math-Complex' 'Math-Quaternion' 'Math-Numerical' 'Math-Random' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat' 'Math-FastFourierTransform' 'ExtendedNumberParser' 'Math-Quantile' 'Math-Physics-Constants' 'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process' 'Math-Helpers' 'PolyMathDataStructures' 'Math-Distributions'); group: 'Extensions' with: - #('Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-KernelSmoothing' 'Math-Permutation' 'Math-KolmogorovSmirnov'); + #('Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-KernelSmoothing' 'Math-Permutation'); group: 'Tests' with: - #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-KolmogorovSmirnov' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions'); + #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions'); group: 'default' with: #('Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy') ]. diff --git a/src/Math-Distributions/ManifestMathDistributions.class.st b/src/Math-Distributions/ManifestMathDistributions.class.st new file mode 100644 index 000000000..884e25986 --- /dev/null +++ b/src/Math-Distributions/ManifestMathDistributions.class.st @@ -0,0 +1,8 @@ +" +Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser +" +Class { + #name : #ManifestMathDistributions, + #superclass : #PackageManifest, + #category : #'Math-Distributions-Manifest' +} diff --git a/src/Math-KolmogorovSmirnov/PMKolmogorovsDistribution.class.st b/src/Math-Distributions/PMKolmogorovsDistribution.class.st similarity index 97% rename from src/Math-KolmogorovSmirnov/PMKolmogorovsDistribution.class.st rename to src/Math-Distributions/PMKolmogorovsDistribution.class.st index cb00c7004..4eeba7655 100644 --- a/src/Math-KolmogorovSmirnov/PMKolmogorovsDistribution.class.st +++ b/src/Math-Distributions/PMKolmogorovsDistribution.class.st @@ -12,7 +12,7 @@ Class { 'distribution', 'n' ], - #category : #'Math-KolmogorovSmirnov' + #category : #'Math-Distributions-KolmogorovSmirnov' } { #category : #information } diff --git a/src/Math-KolmogorovSmirnov/package.st b/src/Math-KolmogorovSmirnov/package.st deleted file mode 100644 index e22da989a..000000000 --- a/src/Math-KolmogorovSmirnov/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-KolmogorovSmirnov' } diff --git a/src/Math-KolmogorovSmirnov/PMKolmogorovSmirnov1Sample.class.st b/src/Math-Tests-Distributions/PMKolmogorovSmirnov1Sample.class.st similarity index 98% rename from src/Math-KolmogorovSmirnov/PMKolmogorovSmirnov1Sample.class.st rename to src/Math-Tests-Distributions/PMKolmogorovSmirnov1Sample.class.st index d174563b4..26a8d1328 100644 --- a/src/Math-KolmogorovSmirnov/PMKolmogorovSmirnov1Sample.class.st +++ b/src/Math-Tests-Distributions/PMKolmogorovSmirnov1Sample.class.st @@ -19,7 +19,7 @@ Class { 'distribution', 'popDistribution' ], - #category : #'Math-KolmogorovSmirnov' + #category : #'Math-Tests-Distributions-KolmogorovSmirnov' } { #category : #'instance creation' } diff --git a/src/Math-Tests-KolmogorovSmirnov/PMKolmogorovSmirnov1SampleTest.class.st b/src/Math-Tests-Distributions/PMKolmogorovSmirnov1SampleTest.class.st similarity index 97% rename from src/Math-Tests-KolmogorovSmirnov/PMKolmogorovSmirnov1SampleTest.class.st rename to src/Math-Tests-Distributions/PMKolmogorovSmirnov1SampleTest.class.st index 44a2d2fbf..69870f0f0 100644 --- a/src/Math-Tests-KolmogorovSmirnov/PMKolmogorovSmirnov1SampleTest.class.st +++ b/src/Math-Tests-Distributions/PMKolmogorovSmirnov1SampleTest.class.st @@ -5,7 +5,7 @@ Class { 'distribution', 'test' ], - #category : #'Math-Tests-KolmogorovSmirnov' + #category : #'Math-Tests-Distributions-KolmogorovSmirnov' } { #category : #running } diff --git a/src/Math-KolmogorovSmirnov/PMKolmogorovSmirnov2Sample.class.st b/src/Math-Tests-Distributions/PMKolmogorovSmirnov2Sample.class.st similarity index 98% rename from src/Math-KolmogorovSmirnov/PMKolmogorovSmirnov2Sample.class.st rename to src/Math-Tests-Distributions/PMKolmogorovSmirnov2Sample.class.st index fe4feb925..a01e9892c 100644 --- a/src/Math-KolmogorovSmirnov/PMKolmogorovSmirnov2Sample.class.st +++ b/src/Math-Tests-Distributions/PMKolmogorovSmirnov2Sample.class.st @@ -29,7 +29,7 @@ Class { 'bigSize', 'ksStatistic' ], - #category : #'Math-KolmogorovSmirnov' + #category : #'Math-Tests-Distributions-KolmogorovSmirnov' } { #category : #'instance creation' } diff --git a/src/Math-Tests-KolmogorovSmirnov/PMKolmogorovSmirnov2SampleTest.class.st b/src/Math-Tests-Distributions/PMKolmogorovSmirnov2SampleTest.class.st similarity index 97% rename from src/Math-Tests-KolmogorovSmirnov/PMKolmogorovSmirnov2SampleTest.class.st rename to src/Math-Tests-Distributions/PMKolmogorovSmirnov2SampleTest.class.st index 81e1bff62..a875c7e3b 100644 --- a/src/Math-Tests-KolmogorovSmirnov/PMKolmogorovSmirnov2SampleTest.class.st +++ b/src/Math-Tests-Distributions/PMKolmogorovSmirnov2SampleTest.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'k' ], - #category : #'Math-Tests-KolmogorovSmirnov' + #category : #'Math-Tests-Distributions-KolmogorovSmirnov' } { #category : #running } diff --git a/src/Math-KolmogorovSmirnov/PMKolmogorovSmirnovSample.class.st b/src/Math-Tests-Distributions/PMKolmogorovSmirnovSample.class.st similarity index 94% rename from src/Math-KolmogorovSmirnov/PMKolmogorovSmirnovSample.class.st rename to src/Math-Tests-Distributions/PMKolmogorovSmirnovSample.class.st index 5f326bde4..085318b86 100644 --- a/src/Math-KolmogorovSmirnov/PMKolmogorovSmirnovSample.class.st +++ b/src/Math-Tests-Distributions/PMKolmogorovSmirnovSample.class.st @@ -8,7 +8,7 @@ Class { 'data', 'compareWith' ], - #category : #'Math-KolmogorovSmirnov' + #category : #'Math-Tests-Distributions-KolmogorovSmirnov' } { #category : #accessing } diff --git a/src/Math-Tests-KolmogorovSmirnov/PMKolmogorovsDistributionTest.class.st b/src/Math-Tests-Distributions/PMKolmogorovsDistributionTest.class.st similarity index 97% rename from src/Math-Tests-KolmogorovSmirnov/PMKolmogorovsDistributionTest.class.st rename to src/Math-Tests-Distributions/PMKolmogorovsDistributionTest.class.st index bf20c719e..3a7843342 100644 --- a/src/Math-Tests-KolmogorovSmirnov/PMKolmogorovsDistributionTest.class.st +++ b/src/Math-Tests-Distributions/PMKolmogorovsDistributionTest.class.st @@ -4,7 +4,7 @@ data are taken from: http://www.ism.ac.jp/editsec/aism/pdf/054_3_0577.pdf Class { #name : #PMKolmogorovsDistributionTest, #superclass : #TestCase, - #category : #'Math-Tests-KolmogorovSmirnov' + #category : #'Math-Tests-Distributions-KolmogorovSmirnov' } { #category : #tests } diff --git a/src/Math-Tests-KolmogorovSmirnov/package.st b/src/Math-Tests-KolmogorovSmirnov/package.st deleted file mode 100644 index cc6d4fbb9..000000000 --- a/src/Math-Tests-KolmogorovSmirnov/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-Tests-KolmogorovSmirnov' } From 51366223f87a3561d3331f16e4ceba2314936499 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:15:02 +0100 Subject: [PATCH 07/12] Fix loop --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index 8d59c9dbc..a181dee0b 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -45,7 +45,7 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Complex' with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Helpers'; - package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Numerical' 'Math-Polynomials') ]; + package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Polynomials') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; From 4b60540e24626323b3776d49744db8f838080de6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:16:12 +0100 Subject: [PATCH 08/12] FIx loop 2 --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index a181dee0b..854e57dc8 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -45,7 +45,7 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Complex' with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Helpers'; - package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Polynomials') ]; + package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; From c9ce032395990e09de92e0abbae0ab09b5128756 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:20:10 +0100 Subject: [PATCH 09/12] Merge kernel smoothing --- src/BaselineOfPolyMath/BaselineOfPolyMath.class.st | 9 +++------ .../PMKernelSmoothedDensity.class.st | 2 +- src/Math-KernelSmoothing/package.st | 1 - .../PMSmoothedDensityTest.class.st | 2 +- src/Math-Tests-KernelSmoothing/package.st | 1 - 5 files changed, 5 insertions(+), 10 deletions(-) rename src/{Math-KernelSmoothing => Math-Distributions}/PMKernelSmoothedDensity.class.st (98%) delete mode 100644 src/Math-KernelSmoothing/package.st rename src/{Math-Tests-KernelSmoothing => Math-Tests-Distributions}/PMSmoothedDensityTest.class.st (98%) delete mode 100644 src/Math-Tests-KernelSmoothing/package.st diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index 854e57dc8..b5b96dbd9 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -45,7 +45,7 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Complex' with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Helpers'; - package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures') ]; + package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Quantile') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; @@ -56,7 +56,6 @@ BaselineOfPolyMath >> baseline: spec [ requires: #('Math-Numerical' 'Math-Chromosome' 'Math-Accuracy-Core' 'PolyMathDataStructures' 'Math-Helpers' 'Math-Polynomials') ]; package: 'Math-KDTree'; - package: 'Math-KernelSmoothing' with: [ spec requires: #('Math-Quantile' 'Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Number-Extensions'; package: 'Math-ODE' with: [ spec requires: #('Math-Numerical' 'PolyMathDataStructures' 'Math-Polynomials') ]; package: 'Math-Permutation' with: [ spec requires: #('PolyMathDataStructures' 'Math-Core-Process') ]; @@ -90,8 +89,6 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Tests-FunctionFit'; package: 'Math-Tests-KDTree' with: [ spec requires: #('Math-KDTree') ]; - package: 'Math-Tests-KernelSmoothing' - with: [ spec requires: #('Math-KernelSmoothing') ]; package: 'Math-Tests-Number-Extensions' with: [ spec requires: #('Math-Number-Extensions') ]; package: 'Math-Tests-ODE' with: [ spec requires: #('Math-ODE') ]; @@ -120,10 +117,10 @@ BaselineOfPolyMath >> baseline: spec [ #('Math-Complex' 'Math-Quaternion' 'Math-Numerical' 'Math-Random' 'Math-KDTree' 'Math-ODE' 'Math-ArbitraryPrecisionFloat' 'Math-FastFourierTransform' 'ExtendedNumberParser' 'Math-Quantile' 'Math-Physics-Constants' 'Math-Polynomials' 'Math-TSNE' 'Math-Core-Process' 'Math-Helpers' 'PolyMathDataStructures' 'Math-Distributions'); group: 'Extensions' with: - #('Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-KernelSmoothing' 'Math-Permutation'); + #('Math-Clustering' 'Math-Number-Extensions' 'Math-Chromosome' 'Math-PrincipalComponentAnalysis' 'Math-FunctionFit' 'Math-AutomaticDifferenciation' 'Math-Permutation'); group: 'Tests' with: - #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-KernelSmoothing' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions'); + #('Math-Tests-Clustering' 'Math-Tests-Numerical' 'Math-Tests-Complex' 'Math-Tests-Quaternion' 'Math-Tests-Random' 'Math-Tests-ODE' 'Math-Tests-KDTree' 'Math-Tests-FunctionFit' 'Math-Tests-AutomaticDifferenciation' 'Math-Tests-FastFourierTransform' 'Math-Tests-Accuracy' 'Math-Tests-ArbitraryPrecisionFloat' 'Math-Tests-Quantile' 'Math-Tests-Polynomials' 'Math-Tests-PrincipalComponentAnalysis' 'Math-Tests-Number-Extensions' 'Math-Tests-Permutation' 'Math-Tests-TSNE' 'Math-Tests-Core-Process' 'Math-Tests-Distributions'); group: 'default' with: #('Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy') ]. diff --git a/src/Math-KernelSmoothing/PMKernelSmoothedDensity.class.st b/src/Math-Distributions/PMKernelSmoothedDensity.class.st similarity index 98% rename from src/Math-KernelSmoothing/PMKernelSmoothedDensity.class.st rename to src/Math-Distributions/PMKernelSmoothedDensity.class.st index 8ee861507..acdab60a7 100644 --- a/src/Math-KernelSmoothing/PMKernelSmoothedDensity.class.st +++ b/src/Math-Distributions/PMKernelSmoothedDensity.class.st @@ -16,7 +16,7 @@ Class { 'kernelName', 'ikernel' ], - #category : 'Math-KernelSmoothing' + #category : #'Math-Distributions-KernelSmoothing' } { #category : #information } diff --git a/src/Math-KernelSmoothing/package.st b/src/Math-KernelSmoothing/package.st deleted file mode 100644 index 2922ef1e3..000000000 --- a/src/Math-KernelSmoothing/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-KernelSmoothing' } diff --git a/src/Math-Tests-KernelSmoothing/PMSmoothedDensityTest.class.st b/src/Math-Tests-Distributions/PMSmoothedDensityTest.class.st similarity index 98% rename from src/Math-Tests-KernelSmoothing/PMSmoothedDensityTest.class.st rename to src/Math-Tests-Distributions/PMSmoothedDensityTest.class.st index 4d174473c..d82a5f9b7 100644 --- a/src/Math-Tests-KernelSmoothing/PMSmoothedDensityTest.class.st +++ b/src/Math-Tests-Distributions/PMSmoothedDensityTest.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'density' ], - #category : #'Math-Tests-KernelSmoothing' + #category : #'Math-Tests-Distributions-KernelSmoothing' } { #category : #running } diff --git a/src/Math-Tests-KernelSmoothing/package.st b/src/Math-Tests-KernelSmoothing/package.st deleted file mode 100644 index 988d1f910..000000000 --- a/src/Math-Tests-KernelSmoothing/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : #'Math-Tests-KernelSmoothing' } From 39a3c1d119f453fdd8c08ba3b21fa9b9b61f074a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:36:02 +0100 Subject: [PATCH 10/12] Move distributions from Numerical to Distributions --- .../PMCauchyDistribution.class.st | 2 +- .../PMExponentialDistribution.class.st | 2 +- .../PMFisherTippettDistribution.class.st | 2 +- .../PMHistogrammedDistribution.class.st | 2 +- ...MIncompleteBetaFractionTermServer.class.st | 2 +- ...IncompleteGammaFractionTermServer.class.st | 2 +- ...PMIncompleteGammaSeriesTermServer.class.st | 2 +- .../PMLaplaceDistribution.class.st | 2 +- .../PMLaplaceGenerator.class.st | 2 +- .../PMLogNormalDistribution.class.st | 24 ++++++- ...PMProbabilityDistributionFunction.class.st | 2 +- .../PMRombergIntegrator.class.st | 2 +- .../PMSeriesTermServer.class.st | 2 +- .../PMSimpsonIntegrator.class.st | 2 +- .../PMTrapezeIntegrator.class.st | 2 +- .../PMTriangularDistribution.class.st | 2 +- .../PMUniformDistribution.class.st | 2 +- .../PMWeibullDistribution.class.st | 2 +- .../PMIncompleteBetaFunctionFraction.class.st | 70 ------------------- ...ityDensityWithUnknownDistribution.class.st | 25 ------- .../PMStatisticsBugs.class.st | 14 +++- .../PMNumericalMethodsTestCase.class.st | 12 ---- 22 files changed, 52 insertions(+), 127 deletions(-) rename src/{Math-Numerical => Math-Distributions}/PMCauchyDistribution.class.st (98%) rename src/{Math-Numerical => Math-Distributions}/PMExponentialDistribution.class.st (98%) rename src/{Math-Numerical => Math-Distributions}/PMFisherTippettDistribution.class.st (98%) rename src/{Math-Numerical => Math-Distributions}/PMHistogrammedDistribution.class.st (98%) rename src/{Math-Numerical => Math-Distributions}/PMIncompleteBetaFractionTermServer.class.st (94%) rename src/{Math-Numerical => Math-Distributions}/PMIncompleteGammaFractionTermServer.class.st (93%) rename src/{Math-Numerical => Math-Distributions}/PMIncompleteGammaSeriesTermServer.class.st (92%) rename src/{Math-Numerical => Math-Distributions}/PMLaplaceDistribution.class.st (98%) rename src/{Math-Numerical => Math-Distributions}/PMLaplaceGenerator.class.st (96%) rename src/{Math-Numerical => Math-Distributions}/PMLogNormalDistribution.class.st (79%) rename src/{Math-Numerical => Math-Distributions}/PMProbabilityDistributionFunction.class.st (94%) rename src/{Math-Numerical => Math-Distributions}/PMRombergIntegrator.class.st (97%) rename src/{Math-Numerical => Math-Distributions}/PMSeriesTermServer.class.st (83%) rename src/{Math-Numerical => Math-Distributions}/PMSimpsonIntegrator.class.st (90%) rename src/{Math-Numerical => Math-Distributions}/PMTrapezeIntegrator.class.st (97%) rename src/{Math-Numerical => Math-Distributions}/PMTriangularDistribution.class.st (99%) rename src/{Math-Numerical => Math-Distributions}/PMUniformDistribution.class.st (98%) rename src/{Math-Numerical => Math-Distributions}/PMWeibullDistribution.class.st (99%) delete mode 100644 src/Math-Numerical/PMIncompleteBetaFunctionFraction.class.st delete mode 100644 src/Math-Numerical/PMProbabilityDensityWithUnknownDistribution.class.st rename src/{Math-Tests-Numerical => Math-Tests-Distributions}/PMStatisticsBugs.class.st (96%) diff --git a/src/Math-Numerical/PMCauchyDistribution.class.st b/src/Math-Distributions/PMCauchyDistribution.class.st similarity index 98% rename from src/Math-Numerical/PMCauchyDistribution.class.st rename to src/Math-Distributions/PMCauchyDistribution.class.st index 9b34d1297..785b462eb 100644 --- a/src/Math-Numerical/PMCauchyDistribution.class.st +++ b/src/Math-Distributions/PMCauchyDistribution.class.st @@ -8,7 +8,7 @@ Class { 'mu', 'beta' ], - #category : #'Math-Numerical-Math-Distribution' + #category : #'Math-Distributions' } { #category : #information } diff --git a/src/Math-Numerical/PMExponentialDistribution.class.st b/src/Math-Distributions/PMExponentialDistribution.class.st similarity index 98% rename from src/Math-Numerical/PMExponentialDistribution.class.st rename to src/Math-Distributions/PMExponentialDistribution.class.st index 962727adb..59d566e70 100644 --- a/src/Math-Numerical/PMExponentialDistribution.class.st +++ b/src/Math-Distributions/PMExponentialDistribution.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'beta' ], - #category : #'Math-Numerical-Math-Distribution' + #category : #'Math-Distributions' } { #category : #information } diff --git a/src/Math-Numerical/PMFisherTippettDistribution.class.st b/src/Math-Distributions/PMFisherTippettDistribution.class.st similarity index 98% rename from src/Math-Numerical/PMFisherTippettDistribution.class.st rename to src/Math-Distributions/PMFisherTippettDistribution.class.st index 39a78a546..ea78be645 100644 --- a/src/Math-Numerical/PMFisherTippettDistribution.class.st +++ b/src/Math-Distributions/PMFisherTippettDistribution.class.st @@ -5,7 +5,7 @@ Class { 'alpha', 'beta' ], - #category : #'Math-Numerical-Math-Distribution' + #category : #'Math-Distributions' } { #category : #information } diff --git a/src/Math-Numerical/PMHistogrammedDistribution.class.st b/src/Math-Distributions/PMHistogrammedDistribution.class.st similarity index 98% rename from src/Math-Numerical/PMHistogrammedDistribution.class.st rename to src/Math-Distributions/PMHistogrammedDistribution.class.st index 55ffb26af..034839be6 100644 --- a/src/Math-Numerical/PMHistogrammedDistribution.class.st +++ b/src/Math-Distributions/PMHistogrammedDistribution.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'histogram' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions' } { #category : #information } diff --git a/src/Math-Numerical/PMIncompleteBetaFractionTermServer.class.st b/src/Math-Distributions/PMIncompleteBetaFractionTermServer.class.st similarity index 94% rename from src/Math-Numerical/PMIncompleteBetaFractionTermServer.class.st rename to src/Math-Distributions/PMIncompleteBetaFractionTermServer.class.st index 71aa9aaf7..3d57d5178 100644 --- a/src/Math-Numerical/PMIncompleteBetaFractionTermServer.class.st +++ b/src/Math-Distributions/PMIncompleteBetaFractionTermServer.class.st @@ -5,7 +5,7 @@ Class { 'alpha1', 'alpha2' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions-Beta' } { #category : #information } diff --git a/src/Math-Numerical/PMIncompleteGammaFractionTermServer.class.st b/src/Math-Distributions/PMIncompleteGammaFractionTermServer.class.st similarity index 93% rename from src/Math-Numerical/PMIncompleteGammaFractionTermServer.class.st rename to src/Math-Distributions/PMIncompleteGammaFractionTermServer.class.st index 7ed7ab202..941204890 100644 --- a/src/Math-Numerical/PMIncompleteGammaFractionTermServer.class.st +++ b/src/Math-Distributions/PMIncompleteGammaFractionTermServer.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'alpha' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions-Gamma' } { #category : #information } diff --git a/src/Math-Numerical/PMIncompleteGammaSeriesTermServer.class.st b/src/Math-Distributions/PMIncompleteGammaSeriesTermServer.class.st similarity index 92% rename from src/Math-Numerical/PMIncompleteGammaSeriesTermServer.class.st rename to src/Math-Distributions/PMIncompleteGammaSeriesTermServer.class.st index fe48ab911..9bec12b2e 100644 --- a/src/Math-Numerical/PMIncompleteGammaSeriesTermServer.class.st +++ b/src/Math-Distributions/PMIncompleteGammaSeriesTermServer.class.st @@ -5,7 +5,7 @@ Class { 'alpha', 'sum' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions-Gamma' } { #category : #information } diff --git a/src/Math-Numerical/PMLaplaceDistribution.class.st b/src/Math-Distributions/PMLaplaceDistribution.class.st similarity index 98% rename from src/Math-Numerical/PMLaplaceDistribution.class.st rename to src/Math-Distributions/PMLaplaceDistribution.class.st index fd0077397..2236aa748 100644 --- a/src/Math-Numerical/PMLaplaceDistribution.class.st +++ b/src/Math-Distributions/PMLaplaceDistribution.class.st @@ -5,7 +5,7 @@ Class { 'mu', 'beta' ], - #category : #'Math-Numerical-Math-Distribution' + #category : #'Math-Distributions' } { #category : #information } diff --git a/src/Math-Numerical/PMLaplaceGenerator.class.st b/src/Math-Distributions/PMLaplaceGenerator.class.st similarity index 96% rename from src/Math-Numerical/PMLaplaceGenerator.class.st rename to src/Math-Distributions/PMLaplaceGenerator.class.st index 4976c9284..7341ff038 100644 --- a/src/Math-Numerical/PMLaplaceGenerator.class.st +++ b/src/Math-Distributions/PMLaplaceGenerator.class.st @@ -11,7 +11,7 @@ Class { 'laplaceDistribution', 'next' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions' } { #category : #testing } diff --git a/src/Math-Numerical/PMLogNormalDistribution.class.st b/src/Math-Distributions/PMLogNormalDistribution.class.st similarity index 79% rename from src/Math-Numerical/PMLogNormalDistribution.class.st rename to src/Math-Distributions/PMLogNormalDistribution.class.st index 2f5463611..0a510fc96 100644 --- a/src/Math-Numerical/PMLogNormalDistribution.class.st +++ b/src/Math-Distributions/PMLogNormalDistribution.class.st @@ -1,10 +1,10 @@ Class { #name : #PMLogNormalDistribution, - #superclass : #PMProbabilityDensityWithUnknownDistribution, + #superclass : #PMProbabilityDensity, #instVars : [ 'normalDistribution' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions-Normal' } { #category : #information } @@ -42,6 +42,13 @@ PMLogNormalDistribution class >> new: aNumber1 sigma: aNumber2 [ ^super new initialize: aNumber1 sigma: aNumber2 ] +{ #category : #information } +PMLogNormalDistribution >> acceptanceBetween: aNumber1 and: aNumber2 [ + "Answers the probability of observing a random variable distributed according to + the receiver with a value larger than aNumber 1 and lower than or equal to aNumber2." + ^( PMRombergIntegrator function: [:x| self value:x] from: aNumber1 to: aNumber2) evaluate +] + { #category : #information } PMLogNormalDistribution >> average [ "Answer the average of the receiver." @@ -54,6 +61,14 @@ PMLogNormalDistribution >> changeParametersBy: aVector [ normalDistribution changeParametersBy: aVector. ] +{ #category : #information } +PMLogNormalDistribution >> distributionValue: aNumber [ + "Answers the probability of observing a random variable distributed according to + the receiver with a value lower than or equal to aNumber. + This general purpose routine uses numerical integration." + ^( PMRombergIntegrator function: [:x| self value:x] from: self lowestValue to: aNumber) evaluate +] + { #category : #information } PMLogNormalDistribution >> fourthCentralMoment [ "Private" @@ -79,6 +94,11 @@ PMLogNormalDistribution >> kurtosis [ ^( ( x + 2) * x + 3) * ( x squared) - 6 ] +{ #category : #information } +PMLogNormalDistribution >> lowestValue [ + ^0 +] + { #category : #information } PMLogNormalDistribution >> parameters [ ^normalDistribution parameters diff --git a/src/Math-Numerical/PMProbabilityDistributionFunction.class.st b/src/Math-Distributions/PMProbabilityDistributionFunction.class.st similarity index 94% rename from src/Math-Numerical/PMProbabilityDistributionFunction.class.st rename to src/Math-Distributions/PMProbabilityDistributionFunction.class.st index 5019ea3cd..178a0e375 100644 --- a/src/Math-Numerical/PMProbabilityDistributionFunction.class.st +++ b/src/Math-Distributions/PMProbabilityDistributionFunction.class.st @@ -4,7 +4,7 @@ Class { #instVars : [ 'probabilityDensity' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions' } { #category : #creation } diff --git a/src/Math-Numerical/PMRombergIntegrator.class.st b/src/Math-Distributions/PMRombergIntegrator.class.st similarity index 97% rename from src/Math-Numerical/PMRombergIntegrator.class.st rename to src/Math-Distributions/PMRombergIntegrator.class.st index 662894cf9..ff8fc4e9f 100644 --- a/src/Math-Numerical/PMRombergIntegrator.class.st +++ b/src/Math-Distributions/PMRombergIntegrator.class.st @@ -21,7 +21,7 @@ Class { 'points', 'interpolator' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions-Core' } { #category : #information } diff --git a/src/Math-Numerical/PMSeriesTermServer.class.st b/src/Math-Distributions/PMSeriesTermServer.class.st similarity index 83% rename from src/Math-Numerical/PMSeriesTermServer.class.st rename to src/Math-Distributions/PMSeriesTermServer.class.st index 52db49989..bee067dbd 100644 --- a/src/Math-Numerical/PMSeriesTermServer.class.st +++ b/src/Math-Distributions/PMSeriesTermServer.class.st @@ -5,7 +5,7 @@ Class { 'x', 'lastTerm' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions-Gamma' } { #category : #initialization } diff --git a/src/Math-Numerical/PMSimpsonIntegrator.class.st b/src/Math-Distributions/PMSimpsonIntegrator.class.st similarity index 90% rename from src/Math-Numerical/PMSimpsonIntegrator.class.st rename to src/Math-Distributions/PMSimpsonIntegrator.class.st index 2349de7f1..5b862ff09 100644 --- a/src/Math-Numerical/PMSimpsonIntegrator.class.st +++ b/src/Math-Distributions/PMSimpsonIntegrator.class.st @@ -1,7 +1,7 @@ Class { #name : #PMSimpsonIntegrator, #superclass : #PMTrapezeIntegrator, - #category : #'Math-Numerical' + #category : #'Math-Distributions-Core' } { #category : #operation } diff --git a/src/Math-Numerical/PMTrapezeIntegrator.class.st b/src/Math-Distributions/PMTrapezeIntegrator.class.st similarity index 97% rename from src/Math-Numerical/PMTrapezeIntegrator.class.st rename to src/Math-Distributions/PMTrapezeIntegrator.class.st index da842e5df..0e89af863 100644 --- a/src/Math-Numerical/PMTrapezeIntegrator.class.st +++ b/src/Math-Distributions/PMTrapezeIntegrator.class.st @@ -12,7 +12,7 @@ Class { 'sum', 'step' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions-Core' } { #category : #information } diff --git a/src/Math-Numerical/PMTriangularDistribution.class.st b/src/Math-Distributions/PMTriangularDistribution.class.st similarity index 99% rename from src/Math-Numerical/PMTriangularDistribution.class.st rename to src/Math-Distributions/PMTriangularDistribution.class.st index 01e5f05af..2c2dbad5f 100644 --- a/src/Math-Numerical/PMTriangularDistribution.class.st +++ b/src/Math-Distributions/PMTriangularDistribution.class.st @@ -6,7 +6,7 @@ Class { 'highLimit', 'peak' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions' } { #category : #information } diff --git a/src/Math-Numerical/PMUniformDistribution.class.st b/src/Math-Distributions/PMUniformDistribution.class.st similarity index 98% rename from src/Math-Numerical/PMUniformDistribution.class.st rename to src/Math-Distributions/PMUniformDistribution.class.st index 69d59ed63..b988d797a 100644 --- a/src/Math-Numerical/PMUniformDistribution.class.st +++ b/src/Math-Distributions/PMUniformDistribution.class.st @@ -5,7 +5,7 @@ Class { 'lowLimit', 'highLimit' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions' } { #category : #public } diff --git a/src/Math-Numerical/PMWeibullDistribution.class.st b/src/Math-Distributions/PMWeibullDistribution.class.st similarity index 99% rename from src/Math-Numerical/PMWeibullDistribution.class.st rename to src/Math-Distributions/PMWeibullDistribution.class.st index 5ef1c1f36..c6f19090a 100644 --- a/src/Math-Numerical/PMWeibullDistribution.class.st +++ b/src/Math-Distributions/PMWeibullDistribution.class.st @@ -6,7 +6,7 @@ Class { 'beta', 'norm' ], - #category : #'Math-Numerical' + #category : #'Math-Distributions' } { #category : #information } diff --git a/src/Math-Numerical/PMIncompleteBetaFunctionFraction.class.st b/src/Math-Numerical/PMIncompleteBetaFunctionFraction.class.st deleted file mode 100644 index fa2eb7679..000000000 --- a/src/Math-Numerical/PMIncompleteBetaFunctionFraction.class.st +++ /dev/null @@ -1,70 +0,0 @@ -Class { - #name : #PMIncompleteBetaFunctionFraction, - #superclass : #PMIterativeProcess, - #instVars : [ - 'x', - 'q1', - 'q2', - 'q3', - 'numerator', - 'denominator', - 'alpha1', - 'alpha2' - ], - #category : #'Math-Numerical' -} - -{ #category : #creation } -PMIncompleteBetaFunctionFraction class >> shape: aNumber1 shape: aNumber2 [ - "Create an instance of the receiver with given shape parameters." - - ^ super new initialize: aNumber1 shape: aNumber2 -] - -{ #category : #operation } -PMIncompleteBetaFunctionFraction >> evaluateIteration [ - "Compute and add the next term of the fraction." - - | m m2 temp | - m := iterations + 1. - m2 := m * 2. - temp := m * (alpha2 - m) * x - / ((q3 + m2) * (alpha1 + m2)). - denominator := self limitedSmallValue: ( denominator * temp + 1). - numerator := self limitedSmallValue: ( temp / numerator + 1). - denominator := 1 / denominator. - result := result * numerator * denominator. - temp := (alpha1 + m) negated * (q1 + m) * x - / ((q2 + m2) * (alpha1 + m2)). - denominator := self limitedSmallValue: ( denominator * temp + 1). - numerator := self limitedSmallValue: ( temp / numerator + 1). - denominator := 1 / denominator. - temp := numerator * denominator. - result := result * temp. - ^(temp - 1) abs -] - -{ #category : #initialization } -PMIncompleteBetaFunctionFraction >> initialize: aNumber1 shape: aNumber2 [ - "Private - Initialize the parameters of the receiver." - - alpha1 := aNumber1. - alpha2 := aNumber2. - q1 := alpha1 + alpha2. - q2 := alpha1 + 1. - q3 := alpha1 - 1 -] - -{ #category : #operation } -PMIncompleteBetaFunctionFraction >> initializeIterations [ - "Initialize the iterations (subclasses must write their own method and call this one last)." - - numerator := 1. - denominator := 1 / (self limitedSmallValue: 1 - (q1 * x / q2)). - result := denominator -] - -{ #category : #initialization } -PMIncompleteBetaFunctionFraction >> setArgument: aNumber [ - x := aNumber -] diff --git a/src/Math-Numerical/PMProbabilityDensityWithUnknownDistribution.class.st b/src/Math-Numerical/PMProbabilityDensityWithUnknownDistribution.class.st deleted file mode 100644 index 0baa2c47b..000000000 --- a/src/Math-Numerical/PMProbabilityDensityWithUnknownDistribution.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : #PMProbabilityDensityWithUnknownDistribution, - #superclass : #PMProbabilityDensity, - #category : #'Math-Numerical' -} - -{ #category : #information } -PMProbabilityDensityWithUnknownDistribution >> acceptanceBetween: aNumber1 and: aNumber2 [ - "Answers the probability of observing a random variable distributed according to - the receiver with a value larger than aNumber 1 and lower than or equal to aNumber2." - ^( PMRombergIntegrator function: [:x| self value:x] from: aNumber1 to: aNumber2) evaluate -] - -{ #category : #information } -PMProbabilityDensityWithUnknownDistribution >> distributionValue: aNumber [ - "Answers the probability of observing a random variable distributed according to - the receiver with a value lower than or equal to aNumber. - This general purpose routine uses numerical integration." - ^( PMRombergIntegrator function: [:x| self value:x] from: self lowestValue to: aNumber) evaluate -] - -{ #category : #information } -PMProbabilityDensityWithUnknownDistribution >> lowestValue [ - ^0 -] diff --git a/src/Math-Tests-Numerical/PMStatisticsBugs.class.st b/src/Math-Tests-Distributions/PMStatisticsBugs.class.st similarity index 96% rename from src/Math-Tests-Numerical/PMStatisticsBugs.class.st rename to src/Math-Tests-Distributions/PMStatisticsBugs.class.st index 0da261be5..847b075ed 100644 --- a/src/Math-Tests-Numerical/PMStatisticsBugs.class.st +++ b/src/Math-Tests-Distributions/PMStatisticsBugs.class.st @@ -1,7 +1,7 @@ Class { #name : #PMStatisticsBugs, #superclass : #TestCase, - #category : #'Math-Tests-Numerical' + #category : #'Math-Tests-Distributions' } { #category : #tests } @@ -45,6 +45,18 @@ PMStatisticsBugs >> testFisherTippet2 [ self assert: (d distributionValue: -3) equals: -1 exp ] +{ #category : #tests } +PMStatisticsBugs >> testGammaDistribution [ + | dist | + dist := PMGammaDistribution shape: 3.4 scale: 1.7. + self assert: (dist average - (3.4 * 1.7)) abs < 0.000000001. + self + assert: (dist standardDeviation - (3.4 sqrt * 1.7)) abs < 0.000000001. + self assert: ((dist value: 4.5) - 0.1446067652) abs < 0.000000001. + self + assert: ((dist distributionValue: 4.5) - 0.3982869736) abs < 0.000000001 +] + { #category : #tests } PMStatisticsBugs >> testProbabilityDensity [ diff --git a/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st b/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st index fce772877..d81c8e915 100644 --- a/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st +++ b/src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st @@ -124,18 +124,6 @@ PMNumericalMethodsTestCase >> testFTest [ self assert: (confidenceLevel - 79.8147614536) abs < 0.000000001 ] -{ #category : #statistics } -PMNumericalMethodsTestCase >> testGammaDistribution [ - | dist | - dist := PMGammaDistribution shape: 3.4 scale: 1.7. - self assert: (dist average - (3.4 * 1.7)) abs < 0.000000001. - self - assert: (dist standardDeviation - (3.4 sqrt * 1.7)) abs < 0.000000001. - self assert: ((dist value: 4.5) - 0.1446067652) abs < 0.000000001. - self - assert: ((dist distributionValue: 4.5) - 0.3982869736) abs < 0.000000001 -] - { #category : #statistics } PMNumericalMethodsTestCase >> testHistogram [ | histogram | From 129703adc5dad09301aa02cd47a17f424ea170b6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 23 Feb 2023 21:44:52 +0100 Subject: [PATCH 11/12] Better dependencies in Distributions --- .../BaselineOfPolyMath.class.st | 2 +- .../PMTrapezeIntegrator.class.st | 29 +++++++++++++++++-- .../PMFunctionalIterator.class.st | 10 +++---- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st index b5b96dbd9..4813e9bd5 100644 --- a/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st +++ b/src/BaselineOfPolyMath/BaselineOfPolyMath.class.st @@ -45,7 +45,7 @@ BaselineOfPolyMath >> baseline: spec [ package: 'Math-Complex' with: [ spec requires: #('Math-Numerical' 'Math-Polynomials') ]; package: 'Math-Helpers'; - package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Quantile') ]; + package: 'Math-Distributions' with: [ spec requires: #('PolyMathDataStructures' 'Math-Quantile' 'Math-Core-Process') ]; package: 'Math-Core-Process' with: [ spec requires: #('Math-Helpers') ]; package: 'Math-Numerical' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; package: 'Math-Polynomials' with: [ spec requires: #('PolyMathDataStructures' 'Math-Helpers' 'Math-Core-Process' 'Math-Distributions' 'Math-StatisticalMoments' 'Math-Series') ]; diff --git a/src/Math-Distributions/PMTrapezeIntegrator.class.st b/src/Math-Distributions/PMTrapezeIntegrator.class.st index 0e89af863..e73f270e7 100644 --- a/src/Math-Distributions/PMTrapezeIntegrator.class.st +++ b/src/Math-Distributions/PMTrapezeIntegrator.class.st @@ -5,8 +5,9 @@ A PMTrapezeIntegrator is the base class for integration methods. You should not " Class { #name : #PMTrapezeIntegrator, - #superclass : #PMFunctionalIterator, + #superclass : #PMIterativeProcess, #instVars : [ + 'functionBlock', 'from', 'to', 'sum', @@ -28,9 +29,10 @@ PMTrapezeIntegrator class >> function: aBlock from: aNumber1 to: aNumber2 [ { #category : #operation } PMTrapezeIntegrator >> computeInitialValues [ - "Private" + "Private" + step := to - from. - sum := ( ( functionBlock value: from) + ( functionBlock value: to)) * step /2. + sum := (functionBlock value: from) + (functionBlock value: to) * step / 2. result := sum ] @@ -69,3 +71,24 @@ PMTrapezeIntegrator >> initialize: aBlock from: aNumber1 to: aNumber2 [ functionBlock := aBlock. self from: aNumber1 to: aNumber2 ] + +{ #category : #initialization } +PMTrapezeIntegrator >> initializeIterations [ + "If no initial value has been defined, take 0 as the starting point (for lack of anything better)." + + super initializeIterations. + functionBlock ifNil: [ self error: 'No function supplied' ]. + self computeInitialValues +] + +{ #category : #information } +PMTrapezeIntegrator >> relativePrecision: aNumber [ + + ^ self precisionOf: aNumber relativeTo: result abs +] + +{ #category : #initialization } +PMTrapezeIntegrator >> setFunction: aBlock [ + + functionBlock := aBlock +] diff --git a/src/Math-Numerical/PMFunctionalIterator.class.st b/src/Math-Numerical/PMFunctionalIterator.class.st index 8287fbe9f..810208647 100644 --- a/src/Math-Numerical/PMFunctionalIterator.class.st +++ b/src/Math-Numerical/PMFunctionalIterator.class.st @@ -36,19 +36,19 @@ PMFunctionalIterator >> computeInitialValues [ { #category : #operation } PMFunctionalIterator >> initializeIterations [ "If no initial value has been defined, take 0 as the starting point (for lack of anything better)." - - functionBlock isNil ifTrue: [self error: 'No function supplied']. + super initializeIterations. + functionBlock ifNil: [self error: 'No function supplied']. self computeInitialValues ] { #category : #information } PMFunctionalIterator >> relativePrecision: aNumber [ - ^self precisionOf: aNumber relativeTo: result abs + + ^ self precisionOf: aNumber relativeTo: result abs ] { #category : #initialization } PMFunctionalIterator >> setFunction: aBlock [ - ( aBlock respondsTo: #value:) - ifFalse:[ self error: 'Function block must implement the method value:']. + functionBlock := aBlock ] From 708a448730bb0af5e3c5de00a0c87ae725c36cf2 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Fri, 24 Feb 2023 17:08:17 +0100 Subject: [PATCH 12/12] Fix precisions --- src/Math-Tests-ODE/PMBDF4StepperTest.class.st | 79 ++++++++----------- .../PMRungeKuttaStepperTest.class.st | 12 ++- .../PMTrapezoidStepperTest.class.st | 12 ++- 3 files changed, 44 insertions(+), 59 deletions(-) diff --git a/src/Math-Tests-ODE/PMBDF4StepperTest.class.st b/src/Math-Tests-ODE/PMBDF4StepperTest.class.st index a3cfb94da..2ba63d843 100644 --- a/src/Math-Tests-ODE/PMBDF4StepperTest.class.st +++ b/src/Math-Tests-ODE/PMBDF4StepperTest.class.st @@ -44,54 +44,43 @@ PMBDF4StepperTest >> testSimpleSystem2 [ { #category : #'tests-stepping' } PMBDF4StepperTest >> testSimpleSystem3 [ + | solver stepper system dt | dt := 0.5. system := PMImplicitSystem block: [ :x :t | 2 * t * x ]. stepper := PMBDF4Stepper onSystem: system. solver := PMBDF4Solver new - stepper: stepper; - system: system; - dt: dt. - self - assert: - ((solver - solve: system - startState: 1 - startTime: 0 - endTime: 0.5) closeTo: 1.75). - self - assert: - ((solver - solve: system - startState: 1 - startTime: 0 - endTime: 1.0) closeTo: 3.75). - self - assert: - ((solver - solve: system - startState: 1 - startTime: 0 - endTime: 1.5) closeTo: 11.0227). - self - assert: - ((solver - solve: system - startState: 1 - startTime: 0 - endTime: 2.0) closeTo: 43.2181). - self - assert: - ((solver - solve: system - startState: 1 - startTime: 0 - endTime: 2.3) closeTo: 132.2771). - self - assert: - ((solver - solve: system - startState: 1 - startTime: 0 - endTime: 2.5) closeTo: 224.881) + stepper: stepper; + system: system; + dt: dt. + self assert: ((solver + solve: system + startState: 1 + startTime: 0 + endTime: 0.5) closeTo: 1.75). + self assert: ((solver + solve: system + startState: 1 + startTime: 0 + endTime: 1.0) closeTo: 3.75). + self assert: ((solver + solve: system + startState: 1 + startTime: 0 + endTime: 1.5) closeTo: 11.0227). + self assert: ((solver + solve: system + startState: 1 + startTime: 0 + endTime: 2.0) closeTo: 43.2181). + self assert: ((solver + solve: system + startState: 1 + startTime: 0 + endTime: 2.3) closeTo: 132.2771). + self assert: ((solver + solve: system + startState: 1 + startTime: 0 + endTime: 2.5) closeTo: 224.881 precision: 0.001) ] diff --git a/src/Math-Tests-ODE/PMRungeKuttaStepperTest.class.st b/src/Math-Tests-ODE/PMRungeKuttaStepperTest.class.st index d88ddf34e..d1f7a8ec8 100644 --- a/src/Math-Tests-ODE/PMRungeKuttaStepperTest.class.st +++ b/src/Math-Tests-ODE/PMRungeKuttaStepperTest.class.st @@ -6,17 +6,15 @@ Class { { #category : #'tests-stepping' } PMRungeKuttaStepperTest >> testDoStepTimeStepSize1 [ + | stepper sys dt | sys := PMExplicitSystem block: [ :x :t | x * t ]. stepper := PMRungeKuttaStepper onSystem: sys. dt := 0.1. - self assert: ((stepper doStep: 0 time: 10 stepSize: dt) closeTo: 0.0). - self - assert: ((stepper doStep: 10 time: 0 stepSize: dt) closeTo: 10.05). - self - assert: ((stepper doStep: 1 time: 1 stepSize: dt) closeTo: 1.1107). - self - assert: ((stepper doStep: 10 time: 1 stepSize: dt) closeTo: 11.1071) + self assert: ((stepper doStep: 0 time: 10 stepSize: dt) closeTo: 0.0 precision: 0.01). + self assert: ((stepper doStep: 10 time: 0 stepSize: dt) closeTo: 10.05 precision: 0.01). + self assert: ((stepper doStep: 1 time: 1 stepSize: dt) closeTo: 1.1107 precision: 0.01). + self assert: ((stepper doStep: 10 time: 1 stepSize: dt) closeTo: 11.1071 precision: 0.01) ] { #category : #'tests-stepping' } diff --git a/src/Math-Tests-ODE/PMTrapezoidStepperTest.class.st b/src/Math-Tests-ODE/PMTrapezoidStepperTest.class.st index 0c78ebd33..1f524945a 100644 --- a/src/Math-Tests-ODE/PMTrapezoidStepperTest.class.st +++ b/src/Math-Tests-ODE/PMTrapezoidStepperTest.class.st @@ -26,17 +26,15 @@ PMTrapezoidStepperTest >> testDoStepTime [ { #category : #'tests-stepping' } PMTrapezoidStepperTest >> testDoStepTimeStepSize1 [ + | stepper sys dt | sys := PMImplicitSystem block: [ :x :t | x * t ]. stepper := PMTrapezoidStepper onSystem: sys. dt := 0.1. - self assert: ((stepper doStep: 0 time: 10 stepSize: dt) closeTo: 0.0). - self - assert: ((stepper doStep: 10 time: 0 stepSize: dt) closeTo: 10.05). - self - assert: ((stepper doStep: 1 time: 1 stepSize: dt) closeTo: 1.1111). - self - assert: ((stepper doStep: 10 time: 1 stepSize: dt) closeTo: 11.11) + self assert: ((stepper doStep: 0 time: 10 stepSize: dt) closeTo: 0.0 precision: 0.01). + self assert: ((stepper doStep: 10 time: 0 stepSize: dt) closeTo: 10.05 precision: 0.01). + self assert: ((stepper doStep: 1 time: 1 stepSize: dt) closeTo: 1.11 precision: 0.01). + self assert: ((stepper doStep: 10 time: 1 stepSize: dt) closeTo: 11.11 precision: 0.01) ] { #category : #'tests-stepping' }