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

Unexpected number of simulations with multiple cores #7

Open
kalenkovich opened this issue Sep 17, 2019 · 3 comments
Open

Unexpected number of simulations with multiple cores #7

kalenkovich opened this issue Sep 17, 2019 · 3 comments

Comments

@kalenkovich
Copy link

It seems that parameter B of BFDA.sim sets the number of simulations per core and not the total number of simulations. This behavior was unexpected to me. While the help for BFDA.sim does not explicitly stay which way it is, it does say that B "should be dividable by the numbers of cores" which implies that B is the total number of simulations. I think that either the behavior or the docs should be changed. Personally, I would go for the behavior.

Steps to reproduce:

library(BFDA)

sim.H1 <- BFDA.sim(
  expected.ES = 0.5, type = "t.between", alternative = "greater",
  n.max = 20,
  B = 4, cores = 2
)

n_simulations <- length(unique(sim.H1$sim$id))
n_simulations

Output:

8

Expected output:

4

@nicebread
Copy link
Owner

nicebread commented Sep 17, 2019

Interesting, thanks for the note. In fact B should be the number of total simulations, and the expected output is 4, as you wrote.

I ran the code on my system (Mac OS, R version 3.5.2) and it returns the expected number of simulations (i.e., 4).

What version of BFDA, R, and what operating system do you use? Can you post the content of sim.H1$sim$id?

@kalenkovich
Copy link
Author

I'm on Win 7 x64, R version 3.5.1, BFDA 0.5.0.

> sim.H1$sim$id
 [1] 101 101 101 101 101 101 101 101 101 101 101 102 102 102 102 102 102 102 102 102 102
[22] 102 103 103 103 103 103 103 103 103 103 103 103 104 104 104 104 104 104 104 104 104
[43] 104 104 201 201 201 201 201 201 201 201 201 201 201 202 202 202 202 202 202 202 202
[64] 202 202 202 203 203 203 203 203 203 203 203 203 203 203 204 204 204 204 204 204 204
[85] 204 204 204 204

@nicebread
Copy link
Owner

Thanks for the info; might be an OS problem. We'll look into it!

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