Skip to content

Commit ebf80f9

Browse files
committed
Update norm_dist.php
1 parent 213e0b5 commit ebf80f9

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

examples/norm_dist.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require __DIR__ . "/vendor/autoload.php";
3+
require __DIR__ . "/../vendor/autoload.php";
44

55
use HiFolks\Statistics\Freq;
66
use HiFolks\Statistics\NormalDist;
@@ -110,10 +110,10 @@
110110
// --- Thresholds from the model ---
111111
echo PHP_EOL . "=== Performance Thresholds ===" . PHP_EOL . PHP_EOL;
112112

113-
$eliteThreshold = $normal->invCdfRounded(0.1, 2);
114-
$slowThreshold = $normal->invCdfRounded(0.9, 2);
115-
echo "Top 10% fastest (below): " . $eliteThreshold . " seconds" . PHP_EOL;
116-
echo "Slowest 10% (above): " . $slowThreshold . " seconds" . PHP_EOL;
113+
$eliteThreshold = $normal->invCdfRounded(0.2, 2);
114+
$slowThreshold = $normal->invCdfRounded(0.8, 2);
115+
echo "Top 20% fastest (below): " . $eliteThreshold . " seconds" . PHP_EOL;
116+
echo "Slowest 20% (above): " . $slowThreshold . " seconds" . PHP_EOL;
117117

118118
// --- Probability questions ---
119119
echo PHP_EOL . "=== Probability Questions ===" . PHP_EOL . PHP_EOL;
@@ -167,12 +167,15 @@
167167
$z = $normal->zscoreRounded($time, 2);
168168
$zFormatted = ($z >= 0 ? "+" : "") . number_format($z, 2);
169169

170-
echo str_pad($r["name"], 30)
171-
. str_pad(number_format($time, 2) . "s", 10)
172-
. str_pad($tier, 12)
173-
. "z: " . str_pad($zFormatted, 7)
174-
. "(percentile: " . min(round($percentile * 100, 1), 99.9) . "%)"
175-
. PHP_EOL;
170+
echo str_pad($r["name"], 30) .
171+
str_pad(number_format($time, 2) . "s", 10) .
172+
str_pad($tier, 12) .
173+
"z: " .
174+
str_pad($zFormatted, 7) .
175+
"(percentile: " .
176+
min(round($percentile * 100, 1), 99.9) .
177+
"%)" .
178+
PHP_EOL;
176179
}
177180

178181
// --- Frequency Table ---

0 commit comments

Comments
 (0)