pydaarem

pydaarem is a Python port of the R package daarem. It accelerates smooth, monotone fixed-point iterations, such as the expectation maximization (EM) algorithm, with damped Anderson acceleration with restarts and epsilon-monotonicity (DAAREM).

The public API and the control names are the same as in the R package. Tests compare the results of pydaarem with the results of the R package.

pydaarem supports the Python array API standard. It computes with the array library and on the device of the start value, for example NumPy, PyTorch or CuPy, and it returns arrays of that library. The computation uses the float64 data type. The tests compare NumPy and PyTorch results with the R package.

Install

pydaarem is not on PyPI. Install it from a clone of the repository:

pip install .

To use the example data sets, install the datasets extra:

pip install ".[datasets]"

Reference

Henderson, N. C. and Varadhan, R. (2019). Damped Anderson acceleration with restarts and monotonicity control for accelerating EM and EM-like algorithms. Journal of Computational and Graphical Statistics, 28(4), 834-846. https://doi.org/10.1080/10618600.2019.1594835