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

Student t large n #430

Merged
merged 15 commits into from
Oct 12, 2021
Merged

Conversation

Beakerboy
Copy link
Contributor

Translated C code from R. Need to go over it, but looks promising.
The new test cases do not appear in the current develop branch.

@Beakerboy
Copy link
Contributor Author

Beakerboy commented Oct 11, 2021

#429

Potential patch. Currently a hack job at best.

  • May need to create a logGamma function
  • Double check the values of defined constant, epsilon, log_pi, etc.
  • Fix the one failure t = 0, v = 6.

@Beakerboy
Copy link
Contributor Author

WOW! All the high df tests pass!
Only three failures:
t=0 df = 6
t=±2 df = 20

* use log1p when appropriate
* Fix left bitshift
@coveralls
Copy link

coveralls commented Oct 11, 2021

Coverage Status

Coverage increased (+0.002%) to 99.934% when pulling 98387a3 on Beakerboy:StudentT_Large-n into cb4a396 on markrogoyski:develop.

@Beakerboy
Copy link
Contributor Author

Beakerboy commented Oct 11, 2021

Need the following test cases:

  • df > 1000
  • Huge t²/v
  • stirlerr for non 1/2 integers. This section of code will not execute in T...cut it out?

@markrogoyski
Copy link
Owner

            [0, 500, 0.3987429],
            [1, 500, 0.241729],
            [2, 500, 0.05417883],
            [3, 500, 0.004569562],
            [5, 500, 1.962337e-06],

            [0, 1000, 0.3988426],
            [1, 1000, 0.2418498],
            [2, 1000, 0.05408517],
            [3, 1000, 0.004500625],
            [5, 1000, 1.712012e-06],

            [0, 1200, 0.3988592],
            [1, 1200, 0.2418699],
            [2, 1200, 0.05406951],
            [3, 1200, 0.004489151],
            [5, 1200, 1.672771e-06],

            [0, 1500, 0.3988758],
            [1, 1500, 0.2418901],
            [2, 1500, 0.05405383],
            [3, 1500, 0.004477681],
            [5, 1500, 1.634218e-06],

@Beakerboy
Copy link
Contributor Author

And there was much rejoicing....

@markrogoyski
Copy link
Owner

I don't understand any of it...but the tests pass =)

@Beakerboy
Copy link
Contributor Author

It's black magic to me too.

@Beakerboy
Copy link
Contributor Author

This appears to be the source of the algorithm:
https://www.r-project.org/doc/reports/CLoader-dbinom-2002.pdf

@markrogoyski markrogoyski merged commit b7886c7 into markrogoyski:develop Oct 12, 2021
@Beakerboy Beakerboy deleted the StudentT_Large-n branch October 12, 2021 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants