Skip to content

Commit

Permalink
Update StudentT.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Beakerboy committed Oct 11, 2021
1 parent df17c20 commit 98387a3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Probability/Distribution/Continuous/StudentT.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,16 @@ private static function npD0(float $x, float $np)
}

/**
*Computes the log of the error term in Stirling's formula.
* For n > 15, uses the series 1/12n - 1/360n^3 + ...
* For n <=15, integers or half-integers, uses stored values.
* For other n < 15, uses lgamma directly (don't use this to
* write lgamma!)
* The log of the error term in the Stirling-De Moivre factorial series
*
* log(n!) = .5*log(2πn) + n*log(n) - n + δ(n)
* Where δ(n) is the log of the error.
*
* For n <=15, integers or half-integers, uses stored values.
*
* @param float $n
*
* @return float log of the error
*/
private static function stirlerr(float $n)
{
Expand Down

0 comments on commit 98387a3

Please sign in to comment.