@@ -69,6 +69,9 @@ discard block |
||
69 | 69 | ); |
70 | 70 | } |
71 | 71 | |
72 | + /** |
|
73 | + * @param NumberInterface $standardDev |
|
74 | + */ |
|
72 | 75 | public function SDToValue($standardDev) |
73 | 76 | { |
74 | 77 | $standardDev = Numbers::makeOrDont($this->numberType, $standardDev); |
@@ -85,6 +88,9 @@ discard block |
||
85 | 88 | return $this->PDFByValue($value); |
86 | 89 | } |
87 | 90 | |
91 | + /** |
|
92 | + * @param NumberInterface $value |
|
93 | + */ |
|
88 | 94 | public function PDFByValue($value) |
89 | 95 | { |
90 | 96 | $value = Numbers::makeOrDont($this->numberType, $value); |
@@ -19,6 +19,10 @@ |
||
19 | 19 | */ |
20 | 20 | private $sd; |
21 | 21 | |
22 | + /** |
|
23 | + * @param NumberInterface $mean |
|
24 | + * @param NumberInterface $sd |
|
25 | + */ |
|
22 | 26 | public function __construct($mean, $sd) |
23 | 27 | { |
24 | 28 | $mean = Numbers::makeOrDont(Numbers::IMMUTABLE, $mean); |
@@ -56,6 +56,9 @@ discard block |
||
56 | 56 | return $one->subtract($p); |
57 | 57 | } |
58 | 58 | |
59 | + /** |
|
60 | + * @param NumberInterface $x |
|
61 | + */ |
|
59 | 62 | public static function gaussErrorFunction($x) |
60 | 63 | { |
61 | 64 | |
@@ -68,14 +71,26 @@ discard block |
||
68 | 71 | $answer = $answer->multiply( |
69 | 72 | SeriesProvider::maclaurinSeries( |
70 | 73 | $x, |
74 | + |
|
75 | + /** |
|
76 | + * @param NumberInterface $n |
|
77 | + */ |
|
71 | 78 | function ($n) { |
72 | 79 | $negOne = Numbers::make(Numbers::IMMUTABLE, -1); |
73 | 80 | |
74 | 81 | return $negOne->pow($n); |
75 | 82 | }, |
83 | + |
|
84 | + /** |
|
85 | + * @param NumberInterface $n |
|
86 | + */ |
|
76 | 87 | function ($n) { |
77 | 88 | return SequenceProvider::nthOddNumber($n); |
78 | 89 | }, |
90 | + |
|
91 | + /** |
|
92 | + * @param NumberInterface $n |
|
93 | + */ |
|
79 | 94 | function ($n) { |
80 | 95 | $n = Numbers::makeOrDont(Numbers::IMMUTABLE, $n); |
81 | 96 | |
@@ -88,6 +103,9 @@ discard block |
||
88 | 103 | |
89 | 104 | } |
90 | 105 | |
106 | + /** |
|
107 | + * @param NumberInterface $p |
|
108 | + */ |
|
91 | 109 | public static function inverseNormalCDF($p, $precision = 10) |
92 | 110 | { |
93 | 111 | $pi = Numbers::makePi(); |
@@ -52,8 +52,8 @@ |
||
52 | 52 | /** |
53 | 53 | * WARNING: This function is VERY unoptimized. Be careful of large m values. |
54 | 54 | * |
55 | - * @param $m |
|
56 | - * @param $n |
|
55 | + * @param string $m |
|
56 | + * @param integer $n |
|
57 | 57 | * |
58 | 58 | * @return NumberInterface |
59 | 59 | */ |
@@ -20,6 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | protected $base; |
22 | 22 | |
23 | + /** |
|
24 | + * @param integer $precision |
|
25 | + */ |
|
23 | 26 | public function __construct($value, $precision = null, $base = 10) |
24 | 27 | { |
25 | 28 | $this->base = $base; |
@@ -47,6 +50,9 @@ discard block |
||
47 | 50 | return $this->precision; |
48 | 51 | } |
49 | 52 | |
53 | + /** |
|
54 | + * @param NumberInterface $num |
|
55 | + */ |
|
50 | 56 | public function add($num) |
51 | 57 | { |
52 | 58 | $num = Numbers::makeOrDont($this, $num, $this->getPrecision()); |
@@ -77,6 +83,9 @@ discard block |
||
77 | 83 | return $this->setValue($value); |
78 | 84 | } |
79 | 85 | |
86 | + /** |
|
87 | + * @param string $num |
|
88 | + */ |
|
80 | 89 | public function multiply($num) |
81 | 90 | { |
82 | 91 | $num = Numbers::makeOrDont($this, $num, $this->getPrecision()); |
@@ -95,8 +104,8 @@ discard block |
||
95 | 104 | /** |
96 | 105 | * Note about precision: it uses the smaller of the two precisions (significant figures). |
97 | 106 | * |
98 | - * @param $num |
|
99 | - * @return mixed |
|
107 | + * @param NumberInterface $num |
|
108 | + * @return NumberInterface |
|
100 | 109 | */ |
101 | 110 | public function divide($num) |
102 | 111 | { |
@@ -486,6 +495,9 @@ discard block |
||
486 | 495 | return $comparison; |
487 | 496 | } |
488 | 497 | |
498 | + /** |
|
499 | + * @param integer $value |
|
500 | + */ |
|
489 | 501 | public function equals($value) |
490 | 502 | { |
491 | 503 | $value = Numbers::makeOrDont(Numbers::IMMUTABLE, $value, $this->getPrecision()); |
@@ -497,6 +509,9 @@ discard block |
||
497 | 509 | } |
498 | 510 | } |
499 | 511 | |
512 | + /** |
|
513 | + * @param integer $value |
|
514 | + */ |
|
500 | 515 | public function greaterThan($value) |
501 | 516 | { |
502 | 517 | $value = Numbers::makeOrDont(Numbers::IMMUTABLE, $value, $this->getPrecision()); |
@@ -529,6 +544,9 @@ discard block |
||
529 | 544 | } |
530 | 545 | } |
531 | 546 | |
547 | + /** |
|
548 | + * @param integer $value |
|
549 | + */ |
|
532 | 550 | public function lessThanOrEqualTo($value) |
533 | 551 | { |
534 | 552 | $value = Numbers::makeOrDont(Numbers::IMMUTABLE, $value, $this->getPrecision()); |