Skip to content

Commit 80d51f9

Browse files
committed
update docs
1 parent b8d0b06 commit 80d51f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ $probabilities = ['a' => 0.3, 'b' => 0.2, 'c' => 0.5]; // probabilities for cate
14711471
$categorical = new Discrete\Categorical($k, $probabilities);
14721472
$pmf_a = $categorical->pmf('a');
14731473
$mode = $categorical->mode();
1474+
$random = $categorical->rand(); // returns 'a' or 'b' or 'c'
14741475

14751476
// Geometric distribution (failures before the first success)
14761477
$p = 0.5; // success probability
@@ -1549,6 +1550,7 @@ $cdf = $uniform->cdf($k);
15491550
$μ = $uniform->mean();
15501551
$median = $uniform->median();
15511552
$σ² = $uniform->variance();
1553+
$random = $uniform->rand();
15521554

15531555
// Zipf distribution
15541556
$k = 2; // rank

0 commit comments

Comments
 (0)