-
-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logarithm of the Cumulative Distribution Function for a Student's t distribution. #2528
Comments
👋 Hi there! 👋 And thank you for opening your first issue! We will get back to you shortly. 🏃 💨 |
@Planeshifter Would you mind taking a look? |
Hi @soegaard, Thanks for opening this issue! You are correct that the displayed formula is only valid for Your second point with regards to the |
Just thinking out loud: In Mathematica the regularized incomplete Beta function is called https://reference.wolfram.com/language/ref/BetaRegularized.html We need the logarithm, so we can use a combination of
At first sight, I thougt this meant that That is indeed tricky to implement. The reason I noticed FWIW the implementation of "betaincln" in the Racket library is here https://github.com/racket/math/blob/master/math-lib/math/private/functions/incomplete-beta.rkt#L192 I do not know the details of the algorithm used. But the strategy used it to give all functions involved in computing "betainc" a flag |
Related discussion happening on Boost: boostorg/math#1173 |
Wikipedia uses t (not x), but gives the same formula, but for t>0 only:
From "Sampling Student’s T distribution – use of the inverse cumulative distribution function" by William T. Shaw:
And the same formula is returned by
wolframscript
:There is a problem in the implementation of
logcdf
.The implementation basically computes the normal cdf-probability and then takes the logarithm.
This defeats the purpose of having a
logcdf
, which is meant to be used whencdf(x)
isso small it is rounded to 0.
The formula for
cdf
uses the incomplete beta function, which in turn usesbeta
.Your project includes an
betaln
which computes the logarithm of a beta value.A solution must be to use
betaln
to implement an "logarithm of a regularized, incomplete beta function"and use that to implement
logcdf
.The text was updated successfully, but these errors were encountered: