fastmatrix-package: Fast Computation of some Matrices Useful in Statistics

fastmatrix-packageR Documentation

Fast Computation of some Matrices Useful in Statistics

Description

Small set of functions designed to speed up the computation of certain matrix operations that are commonly used in statistics and econometrics. It provides efficient implementations for the computation of several structured matrices, matrix decompositions and statistical procedures, many of which have minimal memory overhead. Furthermore, the package provides interfaces to C code callable by another C code from other R packages.

Details

The fastmatrix package provides functions to the efficient construction of duplication, commutation and symmetrizer matrices with minimal storage requeriments. Common matrix decompositions (e.g. LU, LDL), rank-1 updates (e.g. Cholesky update), iterative solvers for linear systems and other linear algebra utilities, as well as basic matrix operations, such as Hadamard (elementwise) and Kronecker products, the Sherman-Morrison formula and the power method. The package also offers several statistical procedures, namely: the sweep operator, weighted mean and covariance (using online algorithms), ordinary least squares via multiple strategies (Cholesky, QR, SVD, sweep and conjugate gradients), ridge regression (with procedures for selecting the ridge parameter), omnibus tests for univariate normality, multivariate skewness and kurtosis measures, Mahalanobis distance (with positive-definiteness checks), Wilson-Hilferty transformation of gamma variables (useful, for instance, for goodness-of-fit of multivariate normal data), and some random number generators. Finally, the package provides interfaces for code written in C, enabling other R packages (or user-written C code) to access the C routines in the fastmatrix package.

Author(s)

Felipe Osorio faosorios.stat@gmail.com, Alonso Ogueda aogueda@gmu.edu


fastmatrix documentation built on Nov. 5, 2025, 6:21 p.m.