Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Signed-off-by: Philipp Burckhardt <[email protected]>
  • Loading branch information
Planeshifter authored Mar 12, 2024
commit 960dc07d8397e9e2ac986f5d7d6301fdba088d10
Original file line number Diff line number Diff line change
Expand Up @@ -122,27 +122,27 @@ console.log(negativeBinomial.mean(r, p));

// PMF can be used to calculate the probability of getting heads on a specific trial (say on the 8th trial):
console.log(negativeBinomial.pmf(8, r, p));
// => ~0.06042480468749999
// => ~0.06

// CDF can be used to calculate the probability up to a certain number of trials (say up to 8 trials):
console.log(negativeBinomial.cdf(8, r, p));
// => ~0.8665771484375
// => ~0.867

// Quantile can be used to calculate the number of trials at which you can be 80% confident that the actual number will not exceed:
console.log(negativeBinomial.quantile(0.8, r, p));
// => 7

// Standard deviation can be used to calculate the measure of the spread of trials around the mean:
console.log(negativeBinomial.stdev(r, p));
// => ~3.1622776601683795
// => ~3.162

// Skewness can be used to calculate the asymmetry of the distribution of trials:
console.log(negativeBinomial.skewness(r, p));
// => ~0.9486832980505138
// => ~0.949

// MGF can be used for more advanced statistical analyses and generating moments of the distribution:
console.log(negativeBinomial.mgf(0.5, r, p));
// => ~2277.5972997372114
// => ~2277.598
```

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ console.log(negativeBinomial.mean(r, p));

// PMF can be used to calculate the probability of getting heads on a specific trial (say on the 8th trial):
console.log(negativeBinomial.pmf(8, r, p));
// => ~0.06042480468749999
// => ~0.06

// CDF can be used to calculate the probability up to a certain number of trials (say up to 8 trials):
console.log(negativeBinomial.cdf(8, r, p));
// => ~0.8665771484375
// => ~0.867

// Quantile can be used to calculate the number of trials at which you can be 80% confident that the actual number will not exceed:
console.log(negativeBinomial.quantile(0.8, r, p));
// => 7

// Standard deviation can be used to calculate the measure of the spread of trials around the mean:
console.log(negativeBinomial.stdev(r, p));
// => ~3.1622776601683795
// => ~3.162

// Skewness can be used to calculate the asymmetry of the distribution of trials:
console.log(negativeBinomial.skewness(r, p));
// => ~0.9486832980505138
// => ~0.949

// MGF can be used for more advanced statistical analyses and generating moments of the distribution:
console.log(negativeBinomial.mgf(0.5, r, p));
// => ~2277.5972997372114
// => ~2277.597