Describe the bug
When coefficients are highly significant and p-values equal 0.0, the function eplogprob returns NaN. This in turn causes bas.lm or bas.glm to fail if init.probs = "eplogp" is used.
To Reproduce
Steps to reproduce the behavior:
See unit test in test-eplogprob.R
loc <- system.file("testdata", package = "BAS")
load(paste0(loc, "/eplogp-testdata.Rdata"))
prob = eplogprob(lm(Y ~ ., data = df))
expect_true(sum(is.na(prob)) == 0)
Expected behavior
If p-values are less than Machine precision, return max probability as this is just used to sort variables internally and initialize sampling probabilities. Do not set init probs to 1 in this case.
Describe the bug When coefficients are highly significant and p-values equal 0.0, the function
eplogprob
returns NaN. This in turn causes bas.lm or bas.glm to fail ifinit.probs = "eplogp"
is used.To Reproduce Steps to reproduce the behavior:
See unit test in test-eplogprob.R
Expected behavior If p-values are less than Machine precision, return max probability as this is just used to sort variables internally and initialize sampling probabilities. Do not set init probs to 1 in this case.