Skip to content
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

Problems with Student-T distribution #160

Open
Shimuuar opened this issue Jan 1, 2020 · 1 comment
Open

Problems with Student-T distribution #160

Shimuuar opened this issue Jan 1, 2020 · 1 comment
Labels

Comments

@Shimuuar
Copy link
Collaborator

Shimuuar commented Jan 1, 2020

So far following problems with Student-T distribution were identified:

  1. quantile lose precision for p≈0.5 since x becomes close to 1, while p is near zero
quantile :: StudentT -> Double -> Double
quantile (StudentT ndf) p
  | p >= 0 && p <= 1 =
    let x = invIncompleteBeta (0.5 * ndf) 0.5 (2 * min p (1 - p))
    in case sqrt $ ndf * (1 - x) / x of
         r | p < 0.5   -> -r
           | otherwise -> r
  1. Both precision and performance suffer greatly for large degrees of freedom. Reason is likely incomplete beta and its inverse perform poorly for large parameters. However distribution becomes close to normal so other approximations could work!
@Shimuuar Shimuuar added the Bug label Jan 1, 2020
@Shimuuar
Copy link
Collaborator Author

Shimuuar commented Jan 1, 2020

RE 2.

Quick experimentation with mpmath shows that precision becomes worse for larger NDF. (N of ulps of error proportional to NDF). For very large N mpmath fails itself which I think doesn't bring any good news for algorithm being used...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant