lazy.mat {lazy.mat} R Documentation

## lazy.mat: Some useful matrix tools for lazy boys and girls

### Description

This package provides the following categories of functions:

### Matrix Operations

• basis: Generate the Standard Basis Vector

• b_diag: Makes a Block Diagonal Matrix from the Arguments. of the first one, or vice versa.

• Diag: Diag(x) creats a diagonam matrix from its argument vector or matrix.

• matSwp: Matrix Sweep Operator

• Ginv: Generalized Inverse.

• chkginv: Check if the the second matrix is a generalized inverse

• interleave: Interleaves the columns of two matrices.

• pmat: Generate a permutation matrix to switch row or column.

• Kmat: Generate a commutation matrix to convert `vec(A)` to `vec(t(A))`.

• repmat: Stack a matrix n times either horizontally or vertically.

• ssq: Returns the doubly weighted sum of squares of all the elements of A.

• tr: trace of the input matrix.

• transp: Transpose each matrix contained in a list/array/syupermatrix.

• P: Orthogonal Projection Matrix

• Q: Orthogonal Projection Matrix to the Orthogonal Complement

### Vectorization of a Matrix

• vec: Vectorization of a matrix.

• vecdiag: Returns diagonal elements of A as a vector.

• vech: Vectorization of the lower or upper half of a square matrix.

• vechindex: Returns the index to convert vech(Mat) to Mat and vice versa.

• vechinv: Recover the Symmetric Matrix from its lower or upper half elements stored in a vector created by vech function.

• vecindex: Returns the index to convert vec(Mat) to vec(t(Mat)) and vice versa.

### Super Matrix or Partitioned Matrix

• a2l: Convert array to list.

• a2m: Convert array to supermatrix.

• l2a: Convert list to array.

• m2a: Convert supermatrix to array.

• getSM: Extract a submatrix from a supermatrix.

• modSM<-: Assign values to the submatrix of a supermatrix.

• supermat: Declare a supermatrix with SMdim attribute.

• Printb: Print a supermatrix with separator (lazy.tools)

• Mh2Mv: Convert a horizontally stacked supermatrix to a vertially stacked one.

• Mv2Mh: Convert a vertically stacked supermatrix to a horizontally stacked one.

### Linear Algebra and Constraints

• ABtoAB: Linear Constraints Matrices: from (A, d) and (B, c) to (AA,dd,EE,gg) and (BB,cc).

• AtoB: Linear Constraints Matrices: form A to form B conversion.

• BtoA: Linear Constraints Matrices: form B to form A conversion.

• QRGS: QR decomposition of X matrix by the Gram Schmidt. orthogonalization or Finding non redundant columns of X.

### Others

• JacobianMat: Numerical Evaluation of Jacobian of a Function.

• Integrate: Numerical Integration of a Function.

• pathdist: Calculation of Path Distance.

[Package lazy.mat version 0.1.3 Index]