diff --git a/Math/Statistic/Average.php b/Math/Statistic/Average.php index 887cf2293..8395943f9 100755 --- a/Math/Statistic/Average.php +++ b/Math/Statistic/Average.php @@ -27,27 +27,69 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException; */ final class Average { - public const MA3 = [1 / 3, 1 / 3]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MA3 = [1 / 3, 1 / 3, 1 / 3]; - public const MA5 = [0.2, 0.2, 0.2]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MA5 = [0.2, 0.2, 0.2, 0.2, 0.2]; - public const MA2X12 = [5 / 6, 5 / 6, 5 / 6, 5 / 6, 5 / 6, 5 / 6, 0.42]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MAS15 = [-0.009, -0.019, -0.016, 0.009, 2 / 3, 0.144, 0.209, 0.231, 0.209, 0.144, 2 / 3, 0.009, -0.016, -0.019, -0.009]; - public const MA3X3 = [1 / 3, 2 / 9, 1 / 9]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MAS21 = [-0.003, -0.009, -0.014, -0.014, -0.006, 0.017, 0.51, 0.37, 0.134, 0.163, 0.171, 0.163, 0.134, 0.37, 0.51, 0.017, -0.006, -0.014, -0.014, -0.009, -0.003]; - public const MA3X5 = [0.2, 0.2, 2 / 15, 4 / 6]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MAH5 = [-0.73, 0.294, 0.558, 0.294, -0.73]; - public const MAS15 = [0.231, 0.209, 0.144, 2 / 3, 0.009, -0.016, -0.019, -0.009]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MAH9 = [-0.041, -0.01, 0.119, 0.267, 0.330, 0.267, 0.119, -0.010, -0.041]; - public const MAS21 = [0.171, 0.163, 0.134, 0.37, 0.51, 0.017, -0.006, -0.014, -0.014, -0.009, -0.003]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MAH13 = [-0.019, -0.028, 0, 0.66, 0.147, 0.214, 0.240, 0.214, 0.147, 0.66, 0, -0.028, -0.019]; - public const MAH5 = [0.558, 0.294, -0.73]; - - public const MAH9 = [0.330, 0.267, 0.119, -0.010, -0.041]; - - public const MAH13 = [0.240, 0.214, 0.147, 0.66, 0, -0.028, -0.019]; - - public const MAH23 = [0.148, 0.138, 0.122, 0.097, 0.068, 0.039, 0.013, -0.005, -0.015, -0.016, -0.011, -0.004]; + /** + * Moving average weights + * + * @var float[] + * @since 1.0.0 + */ + public const MAH23 = [-0.004, -0.011, -0.016, -0.015, -0.005, 0.013, 0.039, 0.068, 0.097, 0.122, 0.138, 0.148, 0.138, 0.122, 0.097, 0.068, 0.039, 0.013, -0.005, -0.015, -0.016, -0.011, -0.004]; /** * Constructor. diff --git a/Math/Statistic/Forecast/Forecasts.php b/Math/Statistic/Forecast/Forecasts.php index 0f7aeb8cf..67979866e 100755 --- a/Math/Statistic/Forecast/Forecasts.php +++ b/Math/Statistic/Forecast/Forecasts.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Statistic\Forecast; */ final class Forecasts { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get forecast/prediction interval. * diff --git a/Math/Statistic/Forecast/Regression/LevelLevelRegression.php b/Math/Statistic/Forecast/Regression/LevelLevelRegression.php index beb11f144..853659a9c 100755 --- a/Math/Statistic/Forecast/Regression/LevelLevelRegression.php +++ b/Math/Statistic/Forecast/Regression/LevelLevelRegression.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Statistic\Forecast\Regression; */ final class LevelLevelRegression extends RegressionAbstract { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * {@inheritdoc} */ diff --git a/Math/Statistic/Forecast/Regression/LevelLogRegression.php b/Math/Statistic/Forecast/Regression/LevelLogRegression.php index 51d84f96a..6635d881a 100755 --- a/Math/Statistic/Forecast/Regression/LevelLogRegression.php +++ b/Math/Statistic/Forecast/Regression/LevelLogRegression.php @@ -26,6 +26,16 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException; */ final class LevelLogRegression extends RegressionAbstract { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * {@inheritdoc} * diff --git a/Math/Statistic/Forecast/Regression/LogLevelRegression.php b/Math/Statistic/Forecast/Regression/LogLevelRegression.php index d73d463c4..59a96427c 100755 --- a/Math/Statistic/Forecast/Regression/LogLevelRegression.php +++ b/Math/Statistic/Forecast/Regression/LogLevelRegression.php @@ -26,6 +26,16 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException; */ final class LogLevelRegression extends RegressionAbstract { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * {@inheritdoc} * diff --git a/Math/Statistic/Forecast/Regression/LogLogRegression.php b/Math/Statistic/Forecast/Regression/LogLogRegression.php index 9ad23204d..1ce7a17df 100755 --- a/Math/Statistic/Forecast/Regression/LogLogRegression.php +++ b/Math/Statistic/Forecast/Regression/LogLogRegression.php @@ -26,6 +26,16 @@ use phpOMS\Math\Matrix\Exception\InvalidDimensionException; */ final class LogLogRegression extends RegressionAbstract { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * {@inheritdoc} * diff --git a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php index d73f83bd2..57eb5ec52 100755 --- a/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php +++ b/Math/Statistic/Forecast/Regression/MultipleLinearRegression.php @@ -26,6 +26,16 @@ use phpOMS\Math\Matrix\Matrix; */ final class MultipleLinearRegression extends RegressionAbstract { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get linear regression based on scatter plot. * diff --git a/Math/Statistic/Forecast/Regression/PolynomialRegression.php b/Math/Statistic/Forecast/Regression/PolynomialRegression.php index 3bb3f90a7..bec61209a 100755 --- a/Math/Statistic/Forecast/Regression/PolynomialRegression.php +++ b/Math/Statistic/Forecast/Regression/PolynomialRegression.php @@ -27,6 +27,16 @@ use phpOMS\Math\Statistic\Average; */ final class PolynomialRegression { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get linear regression based on scatter plot. * diff --git a/Math/Statistic/Forecast/Regression/RegressionAbstract.php b/Math/Statistic/Forecast/Regression/RegressionAbstract.php index 79a780058..718d8a1e5 100755 --- a/Math/Statistic/Forecast/Regression/RegressionAbstract.php +++ b/Math/Statistic/Forecast/Regression/RegressionAbstract.php @@ -27,6 +27,16 @@ use phpOMS\Math\Statistic\Average; */ abstract class RegressionAbstract { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get linear regression based on scatter plot. * diff --git a/Math/Stochastic/Distribution/BernoulliDistribution.php b/Math/Stochastic/Distribution/BernoulliDistribution.php index 44966a9de..7ed1065b0 100755 --- a/Math/Stochastic/Distribution/BernoulliDistribution.php +++ b/Math/Stochastic/Distribution/BernoulliDistribution.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class BernoulliDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability mass function. * diff --git a/Math/Stochastic/Distribution/BetaDistribution.php b/Math/Stochastic/Distribution/BetaDistribution.php index 914802cfa..d661d9921 100755 --- a/Math/Stochastic/Distribution/BetaDistribution.php +++ b/Math/Stochastic/Distribution/BetaDistribution.php @@ -27,6 +27,16 @@ use phpOMS\Math\Functions\Functions; */ final class BetaDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get expected value. * diff --git a/Math/Stochastic/Distribution/BinomialDistribution.php b/Math/Stochastic/Distribution/BinomialDistribution.php index 309c6b8e8..1cb483ec9 100755 --- a/Math/Stochastic/Distribution/BinomialDistribution.php +++ b/Math/Stochastic/Distribution/BinomialDistribution.php @@ -26,6 +26,16 @@ use phpOMS\Math\Functions\Functions; */ final class BinomialDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get mode. * diff --git a/Math/Stochastic/Distribution/CauchyDistribution.php b/Math/Stochastic/Distribution/CauchyDistribution.php index 4aeb80358..5bebb4bdd 100755 --- a/Math/Stochastic/Distribution/CauchyDistribution.php +++ b/Math/Stochastic/Distribution/CauchyDistribution.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class CauchyDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/ChiSquaredDistribution.php b/Math/Stochastic/Distribution/ChiSquaredDistribution.php index 0b0400c49..50100a293 100755 --- a/Math/Stochastic/Distribution/ChiSquaredDistribution.php +++ b/Math/Stochastic/Distribution/ChiSquaredDistribution.php @@ -74,6 +74,16 @@ final class ChiSquaredDistribution 100 => ['0.995' => 67.328, '0.99' => 70.065, '0.975' => 74.222, '0.95' => 77.929, '0.90' => 82.358, '0.10' => 118.498, '0.05' => 124.342, '0.025' => 129.561, '0.01' => 135.807, '0.005' => 140.169], ]; + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Test hypthesis. * diff --git a/Math/Stochastic/Distribution/ExponentialDistribution.php b/Math/Stochastic/Distribution/ExponentialDistribution.php index e18bd9b23..7a7446ffd 100755 --- a/Math/Stochastic/Distribution/ExponentialDistribution.php +++ b/Math/Stochastic/Distribution/ExponentialDistribution.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class ExponentialDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/FDistribution.php b/Math/Stochastic/Distribution/FDistribution.php index 57d1dfffa..5890ea95f 100755 --- a/Math/Stochastic/Distribution/FDistribution.php +++ b/Math/Stochastic/Distribution/FDistribution.php @@ -26,6 +26,16 @@ use phpOMS\Math\Functions\Beta; */ final class FDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/GammaDistribution.php b/Math/Stochastic/Distribution/GammaDistribution.php index fe209ce07..9b100baf9 100755 --- a/Math/Stochastic/Distribution/GammaDistribution.php +++ b/Math/Stochastic/Distribution/GammaDistribution.php @@ -26,6 +26,16 @@ use phpOMS\Math\Functions\Gamma; */ final class GammaDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function for shape and scale. * diff --git a/Math/Stochastic/Distribution/GeometricDistribution.php b/Math/Stochastic/Distribution/GeometricDistribution.php index d0b81fdea..b58b4a4c1 100755 --- a/Math/Stochastic/Distribution/GeometricDistribution.php +++ b/Math/Stochastic/Distribution/GeometricDistribution.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class GeometricDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability mass function. * diff --git a/Math/Stochastic/Distribution/HypergeometricDistribution.php b/Math/Stochastic/Distribution/HypergeometricDistribution.php index 2c33ba7f8..03a598033 100755 --- a/Math/Stochastic/Distribution/HypergeometricDistribution.php +++ b/Math/Stochastic/Distribution/HypergeometricDistribution.php @@ -26,6 +26,16 @@ use phpOMS\Math\Functions\Functions; */ final class HypergeometricDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability mass function. * diff --git a/Math/Stochastic/Distribution/LaplaceDistribution.php b/Math/Stochastic/Distribution/LaplaceDistribution.php index b407a1566..d4d0b91e1 100755 --- a/Math/Stochastic/Distribution/LaplaceDistribution.php +++ b/Math/Stochastic/Distribution/LaplaceDistribution.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class LaplaceDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/LogDistribution.php b/Math/Stochastic/Distribution/LogDistribution.php index e65b3c3ca..043333726 100755 --- a/Math/Stochastic/Distribution/LogDistribution.php +++ b/Math/Stochastic/Distribution/LogDistribution.php @@ -34,6 +34,16 @@ final class LogDistribution */ public const EPSILON = 4.88e-04; + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability mass function. * diff --git a/Math/Stochastic/Distribution/LogNormalDistribution.php b/Math/Stochastic/Distribution/LogNormalDistribution.php index 84056f43b..0644e0f20 100755 --- a/Math/Stochastic/Distribution/LogNormalDistribution.php +++ b/Math/Stochastic/Distribution/LogNormalDistribution.php @@ -26,6 +26,16 @@ use phpOMS\Math\Functions\Functions; */ final class LogNormalDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/LogisticDistribution.php b/Math/Stochastic/Distribution/LogisticDistribution.php index a2f4bf45f..632f85fb2 100755 --- a/Math/Stochastic/Distribution/LogisticDistribution.php +++ b/Math/Stochastic/Distribution/LogisticDistribution.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class LogisticDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/NormalDistribution.php b/Math/Stochastic/Distribution/NormalDistribution.php index 5e8549f7b..22724e598 100755 --- a/Math/Stochastic/Distribution/NormalDistribution.php +++ b/Math/Stochastic/Distribution/NormalDistribution.php @@ -39,6 +39,16 @@ final class NormalDistribution '0.85' => 1.44, '0.90' => 1.64, '0.95' => 1.96, '0.96' => 2.05, '0.97' => 2.17, '0.98' => 2.33, '0.99' => 2.58, ]; + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Calculate the sample size * diff --git a/Math/Stochastic/Distribution/ParetoDistribution.php b/Math/Stochastic/Distribution/ParetoDistribution.php index ecf64624f..831cd1da5 100755 --- a/Math/Stochastic/Distribution/ParetoDistribution.php +++ b/Math/Stochastic/Distribution/ParetoDistribution.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class ParetoDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/PoissonDistribution.php b/Math/Stochastic/Distribution/PoissonDistribution.php index 7d8579cc8..ca419760e 100755 --- a/Math/Stochastic/Distribution/PoissonDistribution.php +++ b/Math/Stochastic/Distribution/PoissonDistribution.php @@ -27,6 +27,16 @@ use phpOMS\Math\Functions\Gamma; */ final class PoissonDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get density. * diff --git a/Math/Stochastic/Distribution/TDistribution.php b/Math/Stochastic/Distribution/TDistribution.php index fd58b2fab..e88523cfd 100755 --- a/Math/Stochastic/Distribution/TDistribution.php +++ b/Math/Stochastic/Distribution/TDistribution.php @@ -72,6 +72,16 @@ final class TDistribution 1000 => ['0' => 0.000, '0.5' => 0.675, '0.6' => 0.842, '0.7' => 1.037, '0.8' => 1.282, '0.9' => 1.646, '0.95' => 1.962, '0.98' => 2.330, '0.99' => 2.581, '0.998' => 3.098, '0.999' => 3.300,], ]; + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get expected value. * diff --git a/Math/Stochastic/Distribution/UniformDistributionContinuous.php b/Math/Stochastic/Distribution/UniformDistributionContinuous.php index 7bc46b163..f931b29b4 100755 --- a/Math/Stochastic/Distribution/UniformDistributionContinuous.php +++ b/Math/Stochastic/Distribution/UniformDistributionContinuous.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class UniformDistributionContinuous { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get mode. * diff --git a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php index c8099575f..eba8982d2 100755 --- a/Math/Stochastic/Distribution/UniformDistributionDiscrete.php +++ b/Math/Stochastic/Distribution/UniformDistributionDiscrete.php @@ -24,6 +24,16 @@ namespace phpOMS\Math\Stochastic\Distribution; */ final class UniformDistributionDiscrete { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability mass function. * diff --git a/Math/Stochastic/Distribution/WeibullDistribution.php b/Math/Stochastic/Distribution/WeibullDistribution.php index fc3159e27..dc439fa5b 100755 --- a/Math/Stochastic/Distribution/WeibullDistribution.php +++ b/Math/Stochastic/Distribution/WeibullDistribution.php @@ -26,6 +26,16 @@ use phpOMS\Math\Functions\Gamma; */ final class WeibullDistribution { + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Get probability density function. * diff --git a/Math/Stochastic/Distribution/ZTesting.php b/Math/Stochastic/Distribution/ZTesting.php index 1edbc1500..0a83d14bb 100755 --- a/Math/Stochastic/Distribution/ZTesting.php +++ b/Math/Stochastic/Distribution/ZTesting.php @@ -31,15 +31,31 @@ use phpOMS\Math\Statistic\MeasureOfDispersion; */ final class ZTesting { + /** + * Percentile table + * + * @var array + * @since 1.0.0 + */ public const TABLE = [ - '2.58' => 0.99, - '2.33' => 0.98, - '1.96' => 0.95, - '1.64' => 0.90, - '1.44' => 0.85, - '1.28' => 0.80, + '0.99' => 2.58, + '0.98' => 2.33, + '0.95' => 1.96, + '0.90' => 1.64, + '0.85' => 1.44, + '0.80' => 1.28, ]; + /** + * Constructor. + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + private function __construct() + { + } + /** * Test hypthesis. * @@ -58,8 +74,8 @@ final class ZTesting $zSignificance = 0.0; foreach (self::TABLE as $key => $value) { - if ($significance === $value) { - $zSignificance = (float) $key; + if ($significance === (float) $key) { + $zSignificance = $value; } }