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
It seems that parameter
BofBFDA.simsets the number of simulations per core and not the total number of simulations. This behavior was unexpected to me. While the help forBFDA.simdoes not explicitly stay which way it is, it does say thatB"should be dividable by the numbers of cores" which implies thatBis 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:
Output:
8Expected output:
4