jwb133 / bootImpute

Bootstrap inference for multiple imputation
0 stars 0 forks source link

Running bootImpute in parallel #2

Closed mattysimonson closed 4 years ago

mattysimonson commented 4 years ago

Great arXiv page and a really promising package! That said, I don't see an obvious way to parallelize the bootImpute function over multiple cores. (Amelia, for instance, has options for snow and multicore built in as arguments). And I missing something or is this something you're still working on? If it's the latter, is there an ad hoc workaround you would suggest in the mean time?

jwb133 commented 4 years ago

Thanks for the question Matthew - allowing the user to run it across multiple cores would definitely be a great addition. I am not particularly well versed on the technical details for parallelising, so if anyone (including yourself) would know how to adapt the code to do this that would be fantastic. The way bootImpute works is really not that difficult (see the code), so you could maybe manually perform it in parallel using your own code without too much trouble as a workaround.

jwb133 commented 4 years ago

I've now added parallel functionality to the package, in both the function which does imputation (bootImpute) and the one that analyses the bootstrapped imputations (bootImputeAnalyse). You just specify nCores= to the number of cores you want to use. It's currently on a separate branch. To install this run:

devtools::install_github("jwb133/bootImpute", ref="parallel")

It would be fantastic if you could try and it and see if it all runs ok. Thanks.

jwb133 commented 4 years ago

There's an issue with the new parallel version if you need to pass additional arguments through to the imputation function. So please disregard my previous request to try it out.

jwb133 commented 4 years ago

I've now fixed this, and release a new version of the package. Multiple cores can be used both at the bootstrap/imputation stage and analysis stage.