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

phi1 function returns NA or Inf for large values of x #55

Closed
merliseclyde opened this issue Dec 9, 2021 · 1 comment
Closed

phi1 function returns NA or Inf for large values of x #55

merliseclyde opened this issue Dec 9, 2021 · 1 comment

Comments

@merliseclyde
Copy link
Owner

Describe the bug
For large values of the Wald statistic (typical with large n) the current implementation of the Phi1 function in BAS returns NA or Inf
due to overflow in the exponential function. This impacts Bayes factor calculations with several prior distributions
in bas.glm, such as the hyper-g/n

To Reproduce
Steps to reproduce the behavior:

BAS::phi1(1, 2, 1.5, 1000, 1/100)

Reported by Daniel Heeman

@merliseclyde
Copy link
Owner Author

Fixed as of BS 1.6.2

Note

BAS::phi1(1, 2, 1.5, 1000, 1/100, log=FALSE)

still returns Inf

Use

BAS::phi1(1, 2, 1.5, 1000, 1/100, log=TRUE)

as the result is greater that the largest double for exponentiating

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

No branches or pull requests

1 participant