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

bas.lm and bas.glm ignoring prior model probabilities that are 0 #74

Closed
merliseclyde opened this issue Dec 4, 2023 · 1 comment
Closed

Comments

@merliseclyde
Copy link
Owner

Describe the bug
BAS is including models in the output that have prior probability 0.

To Reproduce
Steps to reproduce the behavior:

data("bodyfat")
bas_mod <- bas.lm(Bodyfat ~.,data = bodyfat[1:14,], method = 'BAS', modelprior = tr.poisson(2, 5))
pred <- predict(bas_mod,newdata = bodyfat[15:20,], se.fit = T, estimator = 'BMA') 
cbind(bas_mod$rank, bas_mod$size, bas_mod$postprobs)

Expected behavior

Expect that model with zero prior and posterior probability are dropped from the output and calculations

Desktop (please complete the following information):

  • OS: OSX
  • R Version 4.3.2
  • BAS 1.7.0

Additional context
related to Issue #70

@merliseclyde merliseclyde changed the title bas.lm with `method='BAS' ignores prior model probabilities bas.lm with method='BAS' ignores prior model probabilities Dec 4, 2023
@merliseclyde merliseclyde changed the title bas.lm with method='BAS' ignores prior model probabilities bas.lm with method='BAS' ignores prior model probabilities Dec 4, 2023
@merliseclyde merliseclyde changed the title bas.lm with method='BAS' ignores prior model probabilities bas.lm with method=BAS ignores prior model probabilities Dec 4, 2023
@merliseclyde merliseclyde changed the title bas.lm with method=BAS ignores prior model probabilities bas.lm ignoring prior model probabilities Dec 4, 2023
@merliseclyde merliseclyde changed the title bas.lm ignoring prior model probabilities bas.lm ignoring prior model probabilities that are 0 in method='BAS' Dec 5, 2023
@merliseclyde merliseclyde changed the title bas.lm ignoring prior model probabilities that are 0 in method='BAS' bas.lm and bas.glm ignoring prior model probabilities that are 0 Dec 5, 2023
merliseclyde added a commit that referenced this issue Dec 5, 2023
drop models via postprocessing that have zero prior probability
@merliseclyde
Copy link
Owner Author

partial fix of issue using postprocessing of output to drop all models with prior probability zero. A better solution is to eliminate the models from the tree-structure as they are sampled in C with methods BAS, deterministic and MCMC+BAS as is done with MCMC.

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