Learn R Programming

fastmatrix (version 0.6-2)

Fast Computation of some Matrices Useful in Statistics

Description

Small set of functions to fast computation of some matrices and operations useful in statistics and econometrics. Currently, there are functions for efficient computation of duplication, commutation and symmetrizer matrices with minimal storage requirements. Some commonly used matrix decompositions (LU and LDL), basic matrix operations (for instance, Hadamard, Kronecker products and the Sherman-Morrison formula) and iterative solvers for linear systems are also available. In addition, the package includes a number of common statistical procedures such as the sweep operator, weighted mean and covariance matrix using an online algorithm, linear regression (using Cholesky, QR, SVD, sweep operator and conjugate gradients methods), ridge regression (with optimal selection of the ridge parameter considering several procedures), omnibus tests for univariate normality, functions to compute the multivariate skewness, kurtosis, the Mahalanobis distance (checking the positive defineteness), and the Wilson-Hilferty transformation of gamma variables. Furthermore, the package provides interfaces to C code callable by another C code from other R packages.

Copy Link

Version

Install

install.packages('fastmatrix')

Monthly Downloads

5,247

Version

0.6-2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Felipe Osorio

Last Published

October 15th, 2025

Functions in fastmatrix (0.6-2)

floyd

Find the shortest paths in a directed graph
comm.info

Compact information to construct the commutation matrix
geomean

Geometric mean
harris.test

Test for variance homogeneity of correlated variables
kurtosis

Mardia's multivariate skewness and kurtosis coefficients
corCS

Compound symmetry correlation structure
dupl.prod

Matrix multiplication envolving the duplication matrix
ldl

The LDL decomposition
frank

Frank matrix
hankel

Form a symmetric Hankel matrix
lu2inv

Inverse from LU factorization
hadamard

Hadamard product of two matrices
matrix.fun

Evaluate a matrix function
minkowski

Computes the p-norm of a vector
JarqueBera.test

Jarque-Bera test for univariate normality
matrix.sqrt

Matrix square root
moments

Central moments
jacobi

Solve linear systems using the Jacobi method
matrix.polynomial

Evaluates a real general matrix polynomial
ridge

Ridge regression
matrix.norm

Compute the norm of a rectangular matrix
matrix.inner

Compute the inner product between two rectangular matrices
rball

Generation of deviates uniformly distributed in a unitary ball
kronecker.prod

Kronecker product on matrices
ols

Fit linear regression model
krylov

Computes a Krylov matrix
is.lower.tri

Check if a matrix is lower or upper triangular
helmert

Helmert matrix
symm.info

Compact information to construct the symmetrizer matrix
schur

The Schur decomposition of a square matrix
sweep.operator

Gauss-Jordan sweep operator for symmetric matrices
scaled.condition

Scaled condition number
rsphere

Generation of deviates uniformly located on a spherical surface
wilson.hilferty

Wilson-Hilferty transformation
ols.fit-methods

Fit a linear model
ols.fit

Fitter functions for linear models
rmnorm

Multivariate normal random deviates
whitening

Whitening transformation
power.method

Power method to approximate dominant eigenvalue and eigenvector
vec

Vectorization of a matrix
lu-methods

Reconstruct the L, U, or X matrices from an LU object
sherman.morrison

Sherman-Morrison formula
duplication

Duplication matrix
seidel

Solve linear systems using the Gauss-Seidel method
equilibrate

Equilibration of a rectangular or symmetric matrix
lu

The LU factorization of a square matrix
mchol

The modified Cholesky factorization
mediancenter

Mediancenter
vech

Vectorization the lower triangular part of a square matrix
symm.prod

Matrix multiplication envolving the symmetrizer matrix
symmetrizer

Symmetrizer matrix
asSymmetric

Force a matrix to be symmetric
cov.MSSD

Mean Square Successive Difference (MSSD) estimator of the covariance matrix
bezier

Computation of Bezier curve
cov.weighted

Weighted covariance matrices
ccc

Lin's concordance correlation coefficient
cholupdate

Rank 1 update to Cholesky factorization
commutation

Commutation matrix
cg

Solve linear systems using the conjugate gradients method
dupl.info

Compact information to construct the duplication matrix
WH.normal

Wilson-Hilferty transformation for chi-squared variates
Mahalanobis

Mahalanobis distance
array.mult

Array multiplication
bracket.prod

Bracket product
dupl.cross

Matrix crossproduct envolving the duplication matrix
comm.prod

Matrix multiplication envolving the commutation matrix
circulant

Form a symmetric circulant matrix
corAR1

AR(1) correlation structure