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

MR2 error #1

Open
kspych opened this issue Aug 8, 2023 · 1 comment
Open

MR2 error #1

kspych opened this issue Aug 8, 2023 · 1 comment

Comments

@kspych
Copy link

kspych commented Aug 8, 2023

I am trying to run the MR2 function with 1 exposure and 4 responses (see code below).
MR2_output <- MR2(beta_Y, beta_X, EVgamma = c(1, 1),niter = 7500, burnin = 2500, thin = 5, monitor = 500, seed = 28061971)

However, I am receiving the following error:
Error in if (log(runif(1)) < logAccRatio) { :
missing value where TRUE/FALSE needed

The example 1 simulation ran just fine. Is this happening because I only have 1 exposure?

@lb664
Copy link
Owner

lb664 commented Aug 23, 2023

Yes, you are right. We never thought to have so few exposures. The problem is the BetaBinomial prior, and indeed you see an error message on the MH acceptance probability which includes the distribution of the BetaBinomial prior. Even with a parsimonious parametrisation (1,1), it may require no less than 4 exposures.

Anyway, your comment is interesting, and in the next release, we will add a (less flexible) Binomial prior with user-specific probability of inclusion. Then the number of exposures should not cause any problems.

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

No branches or pull requests

2 participants