|
1 | | -## New Feature: Parallel Imputation (Experimental) |
2 | | - - The `mice()` function now supports parallel execution of imputations via the new `parallel = TRUE` argument. When enabled, imputation chains are distributed across available CPU cores using the `future` and `future.apply` frameworks. Parallel imputation may significantly reduce runtime, especially for large datasets and many imputations (`m`). |
3 | | - - To activate parallel execution: |
4 | | - |
5 | | -```{r} |
6 | | -library(future) |
7 | | -plan(multisession) # or multisession, multicore, cluster, etc. |
8 | | -imp <- mice(data, m = 5, maxit = 5, parallel = TRUE) |
| 1 | +# mice 3.18.0.9000 |
| 2 | + |
| 3 | +> **Experimental release**: Native support for parallel imputation. |
| 4 | +
|
| 5 | +- The `mice()` function now supports parallel execution of imputations via the new `parallel = TRUE` argument. When enabled, instead of sequentially calculating `m` imputations at a given iteration, the `m` chains are distributed across available CPU cores using the `future` and `future.apply` frameworks. |
| 6 | +- Parallel imputation may significantly reduce runtime, especially for large datasets and many imputations (`m`), but does not pay-off for small datasets or few imputations. |
| 7 | +- Parallel execution is implemented only in the `mice()` function, and does not affect the `mice.impute.*()` functions. |
| 8 | + |
| 9 | +- To activate parallel execution: |
| 10 | + |
| 11 | +``` |
| 12 | +library(mice) |
| 13 | +imp <- mice(data, parallel = TRUE) |
9 | 14 | ``` |
10 | 15 |
|
11 | | - - The default is `parallel = FALSE` for backward compatibility. |
12 | | - - A new parallel argument was added to `sampler()` for internal control. |
13 | | - - `printFlag = TRUE` prints iteration and imputation number only in sequential mode; parallel mode reports timing per iteration. |
14 | | - - Note: Users must install the `future` and `future.apply` packages and explicitly choose a parallel backend (e.g., `plan(multisession)`). |
| 16 | +- The default is `parallel = FALSE` for backward compatibility. |
| 17 | +- The argument `n.core` specifies the number of CPU cores to use. If `n.core` is not specified (default) the actual number of cores used is calculated as minimum(number of available cores - 1, number of imputations). |
| 18 | +- `printFlag = TRUE` prints iteration and imputation number only in sequential mode; parallel mode reports timing per iteration. |
| 19 | +- Note: `mice()` will automatically select a parallel backend (default is `multisession`). To override, users may manually call `plan(...)` before running `mice()`. |
| 20 | +- The `future` and `future.apply` packages must be installed to run parallel imputation. If not installed, `mice()` will throw an error and suggest installing the packages. |
| 21 | +- The wrappers `parlmice()` and `futuremice()` are still functional, but now throw a warning that they will be deprecated in the future. Users are encouraged to use the new `parallel` argument in `mice()` instead. |
15 | 22 |
|
16 | 23 | # mice 3.17.3 |
17 | 24 |
|
|
0 commit comments