You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo $normalDist->zscore(85); // -1.0 (one std dev below mean)
584
+
echo $normalDist->zscoreRounded(114, 3); // 0.933
585
+
```
586
+
587
+
------
588
+
535
589
#### Probability Density Function `pdf($x)`
536
590
537
591
Calculates the **Probability Density Function** at a given value xxx:
@@ -585,6 +639,85 @@ echo "CDF at x = 12: $cdf\n"; // Output: 0.8413447460685429
585
639
586
640
------
587
641
642
+
#### Inverse Cumulative Distribution Function `invCdf($p)`
643
+
644
+
Computes the **Inverse Cumulative Distribution Function** (also known as the quantile function or percent-point function). Given a probability `$p`, it finds the value `$x` such that `cdf($x) = $p`.
645
+
646
+
```php
647
+
$normalDist->invCdf(float $p): float
648
+
```
649
+
650
+
- Input: a probability `$p` in the range (0, 1) exclusive.
651
+
- Output: the value `$x` where `cdf($x) = $p`.
652
+
- Throws an exception if `$p` is not in (0, 1).
653
+
654
+
Example:
655
+
656
+
```php
657
+
$normalDist = new NormalDist(0.0, 1.0);
658
+
659
+
// Find the value at the 95th percentile of a standard normal distribution
Computes the overlapping coefficient (OVL) between two normal distributions. Measures the agreement between two normal probability distributions. Returns a value between 0.0 and 1.0 giving the overlapping area in the two underlying probability density functions.
708
+
709
+
```php
710
+
$n1 = new NormalDist(2.4, 1.6);
711
+
$n2 = new NormalDist(3.2, 2.0);
712
+
echo $n1->overlapRounded($n2, 4); // 0.8035
713
+
714
+
// Identical distributions overlap completely
715
+
$n3 = new NormalDist(0, 1);
716
+
echo $n3->overlap($n3); // 1.0
717
+
```
718
+
719
+
------
720
+
588
721
#### Combining a normal distribution via `add()` method
589
722
590
723
The `add()` method allows you to combine a NormalDist instance with either a constant or another NormalDist object.
0 commit comments