Rlinalg Stars#

Linear Algebra routines for Python as implemented in the R language.

Actions Coverage PyPI AUR Wheel Versions Implementations License Source Issues Docs Changelog Downloads

Overview#

The R Project for Statistical Computing provides an environment for using and developing statistical methods. Most of the array manipulation and linear algebra routines are implemented using LAPACK, which can be accessed in Python using SciPy and NumPy. However, when trying to port and reproduce code from R in Python, one can notice differences in the implementation of several routines, in particular in the QR decomposition with pivoting enabled.

The rlinalg library provides linear algebra routines from R using the Fortran sources to allow reproducibility. It exposes an API similar to the scipy interface for similar functions (qr, cond, lstsq), which can be used to get the same results as R. It depends on NumPy, and links to the BLAS libraries available on the system. It is available for all modern Python versions (3.7+). Building is done with Meson and requires a Fortran compiler when compiling from source.

Setup#

Run pip install rlinalg in a shell to download the latest release from PyPi, or have a look at the Installation page to find other ways to install rlinalg.

Library#

License#

This library is provided under the GNU General Public License v3.0 or later. It inclues some code redistributed from the R language, which is licensed under the GNU General Public License v2.0 or later. Some tests were adapted from SciPy, which is developed under the BSD-3-clause license.

This project is in no way not affiliated, sponsored, or otherwise endorsed by the R project developers. It was was developed by Martin Larralde during his PhD project at the Leiden University Medical Center in the Zeller team.