text:
Matrix multiplication

In mathematics, matrix multiplication is a binary operation that takes a pair of matrices, and produces another matrix. Numbers such as the real or complex numbers can be multiplied according to elementary arithmetic. On the other hand, matrices are arrays of numbers, so there is no unique way to define "the" multiplication of matrices. As such, in general the term "matrix multiplication" refers to a number of different ways to multiply matrices. The key features of any matrix multiplication include: the number of rows and columns the original matrices have (called the "size", "order" or "dimension"), and specifying how the entries of the matrices generate the new matrix.

Like vectors, matrices of any size can be multiplied by scalars, which amounts to multiplying every entry of the matrix by the same number. Similar to the entrywise definition of adding or subtracting matrices, multiplication of two matrices of the same size can be defined by multiplying the corresponding entries, and this is known as the Hadamard product. Another definition is the Kronecker product of two matrices, to obtain a block matrix.

One can form many other definitions. However, the most useful definition can be motivated by linear equations and linear transformations on vectors, which have numerous applications in applied mathematics, physics, and engineering. This definition is often called the matrix product.[1][2] In words, if A is an n × m matrix and B is an m × p matrix, their matrix product AB is an n × p matrix, in which the m entries across the rows of A are multiplied with the m entries down the columns of B (the precise definition is below).

This definition is not commutative, although it still retains the associative property and is distributive over entrywise addition of matrices. The identity element of the matrix product is the identity matrix (analogous to multiplying numbers by 1), and a square matrix may have an inverse matrix (analogous to the multiplicative inverse of a number). A consequence of the matrix product is determinant multiplicativity. The matrix product is an important operation in linear transformations, matrix groups, and the theory of group representations and irreps.

Computing matrix products is both a central operation in many numerical algorithms and potentially time consuming, making it one of the most well-studied problems in numerical computing. Various algorithms have been devised for computing C = AB, especially for large matrices.

This article will use the following notational conventions: matrices are represented by capital letters in bold, e.g. A, vectors in lowercase bold, e.g. a, and entries of vectors and matrices are italic (since they are scalars), e.g. A and a. Index notation is often the clearest way to express definitions, and is used as standard in the literature. The i, j entry of matrix A is indicated by (A)ij or Aij, whereas a numerical label (not matrix entries) on a collection of matrices is subscripted only, e.g. A1, A2, etc.

Scalar multiplication

Main article: Scalar multiplication

The simplest form of multiplication associated with matrices is scalar multiplication, which is a special case of the Kronecker product.

The left scalar multiplication of a matrix A with a scalar λ gives another matrix λA of the same size as A. The entries of λA are defined by

$(\lambda \mathbf{A})_{ij} = \lambda\left(\mathbf{A}\right)_{ij}\,,$

explicitly:

$\lambda \mathbf{A} = \lambda \begin{pmatrix} A_{11} & A_{12} & \cdots & A_{1m} \\ A_{21} & A_{22} & \cdots & A_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ A_{n1} & A_{n2} & \cdots & A_{nm} \\ \end{pmatrix} = \begin{pmatrix} \lambda A_{11} & \lambda A_{12} & \cdots & \lambda A_{1m} \\ \lambda A_{21} & \lambda A_{22} & \cdots & \lambda A_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ \lambda A_{n1} & \lambda A_{n2} & \cdots & \lambda A_{nm} \\ \end{pmatrix}\,.$

Similarly, the right scalar multiplication of a matrix A with a scalar λ is defined to be

$(\mathbf{A}\lambda)_{ij} = \left(\mathbf{A}\right)_{ij} \lambda\,,$

explicitly:

$\mathbf{A}\lambda = \begin{pmatrix} A_{11} & A_{12} & \cdots & A_{1m} \\ A_{21} & A_{22} & \cdots & A_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ A_{n1} & A_{n2} & \cdots & A_{nm} \\ \end{pmatrix}\lambda = \begin{pmatrix} A_{11} \lambda & A_{12} \lambda & \cdots & A_{1m} \lambda \\ A_{21} \lambda & A_{22} \lambda & \cdots & A_{2m} \lambda \\ \vdots & \vdots & \ddots & \vdots \\ A_{n1} \lambda & A_{n2} \lambda & \cdots & A_{nm} \lambda \\ \end{pmatrix}\,.$

When the underlying ring is commutative, for example, the real or complex number field, these two multiplications are the same, and are simply called scalar multiplication. However, for matrices over a more general ring that are not commutative, such as the quaternions, they may not be equal.

For a real scalar and matrix:

$\lambda = 2, \quad \mathbf{A} =\begin{pmatrix} a & b \\ c & d \\ \end{pmatrix}$
$2 \mathbf{A} = 2 \begin{pmatrix} a & b \\ c & d \\ \end{pmatrix} = \begin{pmatrix} 2 \!\cdot\! a & 2 \!\cdot\! b \\ 2 \!\cdot\! c & 2 \!\cdot\! d \\ \end{pmatrix} = \begin{pmatrix} a \!\cdot\! 2 & b \!\cdot\! 2 \\ c \!\cdot\! 2 & d \!\cdot\! 2 \\ \end{pmatrix} = \begin{pmatrix} a & b \\ c & d \\ \end{pmatrix}2= \mathbf{A}2.$

For quaternion scalars and matrices:

$\lambda = i, \quad \mathbf{A} = \begin{pmatrix} i & 0 \\ 0 & j \\ \end{pmatrix}$
$i\begin{pmatrix} i & 0 \\ 0 & j \\ \end{pmatrix} = \begin{pmatrix} i^2 & 0 \\ 0 & ij \\ \end{pmatrix} = \begin{pmatrix} -1 & 0 \\ 0 & k \\ \end{pmatrix} \ne \begin{pmatrix} -1 & 0 \\ 0 & -k \\ \end{pmatrix} = \begin{pmatrix} i^2 & 0 \\ 0 & ji \\ \end{pmatrix} = \begin{pmatrix} i & 0 \\ 0 & j \\ \end{pmatrix}i\,,$

where i, j, k are the quaternion units. The non-commutativity of quaternion multiplication prevents the transition of changing ij = +k to ji = −k.

Matrix product (two matrices)

Assume two matrices are to be multiplied (the generalization to any number is discussed below).

General definition of the matrix product

Arithmetic process of multiplying numbers (solid lines) in row i in matrix A and column j in matrix B, then adding the terms (dashed lines) to obtain entry ij in the final matrix.

If A is an n × m matrix and B is an m × p matrix,

$\mathbf{A}=\begin{pmatrix} A_{11} & A_{12} & \cdots & A_{1m} \\ A_{21} & A_{22} & \cdots & A_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ A_{n1} & A_{n2} & \cdots & A_{nm} \\ \end{pmatrix},\quad\mathbf{B}=\begin{pmatrix} B_{11} & B_{12} & \cdots & B_{1p} \\ B_{21} & B_{22} & \cdots & B_{2p} \\ \vdots & \vdots & \ddots & \vdots \\ B_{m1} & B_{m2} & \cdots & B_{mp} \\ \end{pmatrix}$

the matrix product AB (denoted without multiplication signs or dots) is defined to be the n × p matrix[3][4][5][6]

$\mathbf{A}\mathbf{B} =\begin{pmatrix} \left(\mathbf{AB}\right)_{11} & \left(\mathbf{AB}\right)_{12} & \cdots & \left(\mathbf{AB}\right)_{1p} \\ \left(\mathbf{AB}\right)_{21} & \left(\mathbf{AB}\right)_{22} & \cdots & \left(\mathbf{AB}\right)_{2p} \\ \vdots & \vdots & \ddots & \vdots \\ \left(\mathbf{AB}\right)_{n1} & \left(\mathbf{AB}\right)_{n2} & \cdots & \left(\mathbf{AB}\right)_{np} \\ \end{pmatrix}$

where each i, j entry is given by multiplying the entries Aik (across row i of A) by the entries Bkj (down column j of B), for k = 1, 2, ..., m, and summing the results over k:

$(\mathbf{A}\mathbf{B})_{ij} = \sum_{k=1}^m A_{ik}B_{kj}\,.$

Thus the product AB is defined only if the number of columns in A is equal to the number of rows in B, in this case m. Each entry may be computed one at a time. Sometimes, the summation convention is used as it is understood to sum over the repeated index k. To prevent any ambiguity, this convention will not be used in the article.

Usually the entries are numbers or expressions, but can even be matrices themselves (see block matrix). The matrix product can still be calculated exactly the same way. See below for details on how the matrix product can be calculated in terms of blocks taking the forms of rows and columns.

Illustration

The figure to the right illustrates diagrammatically the product of two matrices A and B, showing how each intersection in the product matrix corresponds to a row of A and a column of B.

$\overset{4\times 2 \text{ matrix}}{\begin{bmatrix} {\color{Brown}{a_{11}}} & {\color{Brown}{a_{12}}} \\ \cdot & \cdot \\ {\color{Orange}{a_{31}}} & {\color{Orange}{a_{32}}} \\ \cdot & \cdot \\ \end{bmatrix}} \overset{2\times 3\text{ matrix}}{\begin{bmatrix} \cdot & {\color{Plum}{b_{12}}} & {\color{Violet}{b_{13}}} \\ \cdot & {\color{Plum}{b_{22}}} & {\color{Violet}{b_{23}}} \\ \end{bmatrix}} = \overset{4\times 3\text{ matrix}}{\begin{bmatrix} \cdot & x_{12} & x_{13} \\ \cdot & \cdot & \cdot \\ \cdot & x_{32} & x_{33} \\ \cdot & \cdot & \cdot \\ \end{bmatrix}}$

The values at the intersections marked with circles are:

\begin{align} x_{12} & = {\color{Brown}{a_{11}}}{\color{Plum}{b_{12}}} + {\color{Brown}{a_{12}}}{\color{Plum}{b_{22}}} \\ x_{13} & = {\color{Brown}{a_{11}}}{\color{Violet}{b_{13}}} + {\color{Brown}{a_{12}}}{\color{Violet}{b_{23}}} \\ x_{32} & = {\color{Orange}{a_{31}}}{\color{Plum}{b_{12}}} + {\color{Orange}{a_{32}}}{\color{Plum}{b_{22}}} \\ x_{33} & = {\color{Orange}{a_{31}}}{\color{Violet}{b_{13}}} + {\color{Orange}{a_{32}}}{\color{Violet}{b_{23}}} \end{align}

Examples of matrix products

Row vector and column vector

If

$\mathbf{A} = \begin{pmatrix} a & b & c \end{pmatrix}\,, \quad \mathbf{B} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}\,,$

their matrix products are:

$\mathbf{AB} = \begin{pmatrix} a & b & c \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} = ax + by + cz \,,$

and

$\mathbf{BA} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}\begin{pmatrix} a & b & c \end{pmatrix} = \begin{pmatrix} xa & xb & xc \\ ya & yb & yc \\ za & zb & zc \end{pmatrix} \,.$

Note AB and BA are two different matrices: the first is a 1 × 1 matrix while the second is a 3 × 3 matrix. Such expressions occur for real-valued Euclidean vectors in Cartesian coordinates, displayed as row and column matrices, in which case AB is the matrix form of their dot product, while BA the matrix form of their dyadic or tensor product.

Square matrix and column vector

If

$\mathbf{A} = \begin{pmatrix} a & b & c \\ p & q & r \\ u & v & w \end{pmatrix}, \quad \mathbf{B} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}\,,$

their matrix product is:

$\mathbf{AB} = \begin{pmatrix} a & b & c \\ p & q & r \\ u & v & w \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} =\begin{pmatrix} ax + by + cz \\ px + qy + rz \\ ux + vy + wz \end{pmatrix}\,,$

however BA is not defined.

The product of a square matrix multiplied by a column matrix arises naturally in linear algebra; for solving linear equations and representing linear transformations. By choosing a, b, c, p, q, r, u, v, w in A appropriately, A can represent a variety of transformations such as rotations, scaling and reflections, shears, of a geometric shape in space.

Square matrices

If

$\mathbf{A} = \begin{pmatrix} a & b & c \\ p & q & r \\ u & v & w \end{pmatrix}, \quad \mathbf{B} = \begin{pmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \nu \\ \rho & \sigma & \tau \\ \end{pmatrix}\,,$

their matrix products are:

$\mathbf{AB} = \begin{pmatrix} a & b & c \\ p & q & r \\ u & v & w \end{pmatrix} \begin{pmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \nu \\ \rho & \sigma & \tau \\ \end{pmatrix} =\begin{pmatrix} a\alpha + b\lambda + c\rho & a\beta + b\mu + c\sigma & a\gamma + b\nu + c\tau \\ p\alpha + q\lambda + r\rho & p\beta + q\mu + r\sigma & p\gamma + q\nu + r\tau \\ u\alpha + v\lambda + w\rho & u\beta + v\mu + w\sigma & u\gamma + v\nu + w\tau \end{pmatrix}\,,$

and

$\mathbf{BA} = \begin{pmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \nu \\ \rho & \sigma & \tau \\ \end{pmatrix} \begin{pmatrix} a & b & c \\ p & q & r \\ u & v & w \end{pmatrix} =\begin{pmatrix} \alpha a + \beta p + \gamma u & \alpha b + \beta q + \gamma v & \alpha c + \beta r + \gamma w \\ \lambda a + \mu p + \nu u & \lambda b + \mu q + \nu v & \lambda c + \mu r + \nu w \\ \rho a + \sigma p + \tau u & \rho b + \sigma q + \tau v & \rho c + \sigma r + \tau w \end{pmatrix}\,.$

In this case, both products AB and BA are defined, and the entries show that AB and BA are not equal in general. Multiplying square matrices which represent linear transformations corresponds to the composite transformation (see below for details).

Row vector, square matrix, and column vector

If

$\mathbf{A} = \begin{pmatrix} a & b & c \end{pmatrix}\,, \quad \mathbf{B} = \begin{pmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \nu \\ \rho & \sigma & \tau \\ \end{pmatrix}\,, \quad \mathbf{C} = \begin{pmatrix} x \\ y \\ z \end{pmatrix}\,,$

their matrix product is:

\begin{align} \mathbf{ABC} & = \begin{pmatrix} a & b & c \end{pmatrix} \left[\begin{pmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \nu \\ \rho & \sigma & \tau \\ \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix} \right] = \left[ \begin{pmatrix} a & b & c \end{pmatrix} \begin{pmatrix} \alpha & \beta & \gamma \\ \lambda & \mu & \nu \\ \rho & \sigma & \tau \\ \end{pmatrix} \right] \begin{pmatrix} x \\ y \\ z \end{pmatrix} \\ & = \begin{pmatrix} a & b & c \end{pmatrix}\begin{pmatrix} \alpha x + \beta y + \gamma z \\ \lambda x + \mu y + \nu z \\ \rho x + \sigma y + \tau z \\ \end{pmatrix} = \begin{pmatrix} a\alpha + b\lambda + c\rho & a\beta + b\mu + c\sigma & a\gamma + b\nu + c\tau \end{pmatrix} \begin{pmatrix} x \\ y \\ z \end{pmatrix}\\ & = a\alpha x + b\lambda x + c\rho x + a\beta y + b\mu y + c\sigma y + a\gamma z + b\nu z + c\tau z \,,\end{align}

however CBA is not defined. Note that A(BC) = (AB)C, this is one of many general properties listed below. Expressions of the form ABC occur when calculating the inner product of two vectors displayed as row and column vectors in an arbitrary coordinate system, and the metric tensor in these coordinates written as the square matrix.

Rectangular matrices

If

$\mathbf{A} = \begin{pmatrix} a & b & c \\ x & y & z \end{pmatrix}\,, \quad \mathbf{B} = \begin{pmatrix} \alpha & \rho \\ \beta & \sigma \\ \gamma & \tau \\ \end{pmatrix}\,,$

their matrix products are:

$\mathbf{A}\mathbf{B} = \begin{pmatrix} a & b & c \\ x & y & z \end{pmatrix} \begin{pmatrix} \alpha & \rho \\ \beta & \sigma \\ \gamma & \tau \\ \end{pmatrix} = \begin{pmatrix} a\alpha + b\beta + c \gamma & a\rho + b\sigma + c \tau \\ x\alpha + y\beta + z \gamma & x\rho + y\sigma + z \tau \\ \end{pmatrix} \,,$

and

$\mathbf{B}\mathbf{A} = \begin{pmatrix} \alpha & \rho \\ \beta & \sigma \\ \gamma & \tau \\ \end{pmatrix}\begin{pmatrix} a & b & c \\ x & y & z \end{pmatrix} = \begin{pmatrix} \alpha a + \rho x & \alpha b + \rho y & \alpha c + \rho z \\ \beta a + \sigma x & \beta b + \sigma y & \beta c + \sigma z \\ \gamma a + \tau x & \gamma b + \tau y & \gamma c + \tau z \end{pmatrix} \,.$

Properties of the matrix product (two matrices)

Analogous to numbers (elements of a field), matrices satisfy the following general properties, although there is one subtlety, due to the nature of matrix multiplication.[7][8]

All matrices

1. Not commutative:

In general:

$\mathbf{A}\mathbf{B} \neq \mathbf{B}\mathbf{A}$

because AB and BA may not be simultaneously defined, and even if they are they may still not be equal. This is contrary to ordinary multiplication of numbers. To specify the ordering of matrix multiplication in words; "pre-multiply (or left multiply) A by B" means BA, while "post-multiply (or right multiply) A by C" means AC. As long as the entries of the matrix come from a ring that has an identity, and n > 1 there is a pair of n × n noncommuting matrices over the ring. A notable exception is that the identity matrix (or any scalar multiple of it) commutes with every square matrix.

In index notation:

$\sum_k A_{ik}B_{kj} \neq \sum_k B_{ik}A_{kj}$

Left distributivity:

$\mathbf{A}(\mathbf{B} + \mathbf{C}) = \mathbf{AB} + \mathbf{AC}$

Right distributivity:

$(\mathbf{A} + \mathbf{B} )\mathbf{C} = \mathbf{AC} + \mathbf{BC}$

In index notation, these are respectively:

$\sum_k A_{ik}(B_{kj} + C_{kj}) = \sum_k A_{ik}B_{kj} + \sum_k A_{ik}C_{kj}$
$\sum_k (A_{ik} + B_{ik}) C_{kj} = \sum_k A_{ik}C_{kj} + \sum_k B_{ik}C_{kj}$
3. Scalar multiplication is compatible with matrix multiplication:
$\lambda(\mathbf{AB}) = (\lambda \mathbf{A})\mathbf{B}$ and $(\mathbf{A} \mathbf{B})\lambda=\mathbf{A}(\mathbf{B}\lambda )$

where λ is a scalar. If the entries of the matrix are real or complex numbers (or from any other commutative ring), then all four quantities are equal. More generally, all four are equal if λ belongs to the center of the ring of entries of the matrix, because in this case λX = Xλ for all matrices X. In index notation, these are respectively:

$\lambda \sum_k (A_{ik}B_{kj}) = \sum_k ( \lambda A_{ik} ) B_{kj} = \sum_k A_{ik} ( \lambda B_{kj} )$
$\sum_k (A_{ik}B_{kj}) \lambda = \sum_k ( A_{ik} \lambda ) B_{kj} = \sum_k A_{ik} ( B_{kj} \lambda )$
4. Transpose:
$(\mathbf{AB})^\mathrm{T} = \mathbf{B}^\mathrm{T}\mathbf{A}^\mathrm{T}$

where T denotes the transpose, the interchange of row i with column i in a matrix. This identity holds for any matrices over a commutative ring, but not for all rings in general. Note that A and B are reversed.

In index notation:

\begin{align} \left[(\mathbf{AB})^\mathrm{T}\right]_{ij}&=\left(\mathbf{AB}\right)_{ji}\\ &=\sum_k\left(\mathbf{A}\right)_{jk}\left(\mathbf{B}\right)_{ki}\\ &=\sum_k\left(\mathbf{A}^\mathrm{T}\right)_{kj}\left(\mathbf{B}^\mathrm{T}\right)_{ik}\\ &=\sum_k\left(\mathbf{B}^\mathrm{T}\right)_{ik}\left(\mathbf{A}^\mathrm{T}\right)_{kj}\\ &=\left[\left(\mathbf{B}^\mathrm{T}\right)\left(\mathbf{A}^\mathrm{T}\right)\right]_{ij} \end{align}
5. Complex conjugate:

If A and B have complex entries, then

$(\mathbf{AB})^\star = \mathbf{A}^\star\mathbf{B}^\star$

where * denotes the complex conjugate of a matrix.

In index notation:

\begin{align} \left[(\mathbf{AB})^\star\right]_{ij}&=\left[\sum_k\left(\mathbf{A}\right)_{ik}\left(\mathbf{B}\right)_{kj}\right]^\star\\ &=\sum_k\left(\mathbf{A}\right)^\star_{ik}\left(\mathbf{B}\right)^\star_{kj}\\ &=\sum_k\left(\mathbf{A}^\star\right)_{ik}\left(\mathbf{B}^\star\right)_{kj}\\ &=\left(\mathbf{A}^\star\mathbf{B}^\star\right)_{ij} \end{align}
6. Conjugate transpose:

If A and B have complex entries, then

$(\mathbf{AB})^\dagger = \mathbf{B}^\dagger\mathbf{A}^\dagger$

where denotes the Conjugate transpose of a matrix (complex conjugate and transposed).

In index notation:

\begin{align} \left[(\mathbf{AB})^\dagger\right]_{ij} &=\left[\left(\mathbf{AB}\right)^\star\right]_{ji}\\ &=\sum_k\left(\mathbf{A}^\star\right)_{jk}\left(\mathbf{B}^\star\right)_{ki}\\ &=\sum_k\left(\mathbf{A}^\dagger\right)_{kj}\left(\mathbf{B}^\dagger\right)_{ik}\\ &=\sum_k\left(\mathbf{B}^\dagger\right)_{ik}\left(\mathbf{A}^\dagger\right)_{kj}\\ &=\left[\left(\mathbf{B}^\dagger\right)\left(\mathbf{A}^\dagger\right)\right]_{ij} \end{align}
7. Traces:

The trace of a product AB is independent of the order of A and B:

$\mathrm{tr}(\mathbf{AB}) = \mathrm{tr}(\mathbf{BA})$

In index notation:

\begin{align} \mathrm{tr}(\mathbf{AB}) &=\sum_i \sum_k A_{ik}B_{ki}\\ &=\sum_k\sum_i B_{ki}A_{ik}\\ &=\mathrm{tr}(\mathbf{BA}) \end{align}
For extensive details on differentials and derivatives of products of matrix functions, see matrix calculus.

Square matrices only

Main article: square matrix
1. Identity element:

If A is a square matrix, then

$\mathbf{AI} = \mathbf{IA} = \mathbf{A}$
where I is the identity matrix of the same order.
2. Inverse matrix:

If A is a square matrix, there may be an inverse matrix A−1 of A such that

$\mathbf{A}\mathbf{A}^{-1} = \mathbf{A}^{-1}\mathbf{A} = \mathbf{I}$

If this property holds then A is an invertible matrix, if not A is a singular matrix. Moreover,

$(\mathbf{AB})^\mathrm{-1} = \mathbf{B}^\mathrm{-1}\mathbf{A}^\mathrm{-1}$
3. Determinants:

The determinant of a product AB is the product of the determinants of square matrices A and B (not defined when the underlying ring is not commutative):

$\det(\mathbf{AB}) = \det(\mathbf{A})\det(\mathbf{B})$
Since det(A) and det(B) are just numbers and so commute, det(AB) = det(BA), even when ABBA.

Matrix product (any number)

Matrix multiplication can be extended to the case of more than two matrices, provided that for each sequential pair, their dimensions match.

The product of n matrices A1, A2, ..., An with sizes s0 × s1, s1 × s2, ..., sn − 1 × sn (where s0, s1, s2, ..., sn are all simply positive integers and the subscripts are labels corresponding to the matrices, nothing more), is the s0 × sn matrix:

$\prod_{i=1}^n \mathbf{A}_i = \mathbf{A}_1\mathbf{A}_2\cdots\mathbf{A}_n \, .$

In index notation:

$\left(\mathbf{A}_1\mathbf{A}_2\cdots\mathbf{A}_n\right)_{i_0 i_n} = \sum_{i_1=1}^{s_1}\sum_{i_2=1}^{s_2}\cdots\sum_{i_{n-1}=1}^{s_{n-1}} \left(\mathbf{A}_1\right)_{i_0 i_1}\left(\mathbf{A}_2\right)_{i_1 i_2}\left(\mathbf{A}_3\right)_{i_2 i_3} \cdots \left(\mathbf{A}_{n-1}\right)_{i_{n-2}i_{n-1}}\left(\mathbf{A}_n\right)_{i_{n-1}i_n}$

Properties of the matrix product (any number)

The same properties will hold, as long as the ordering of matrices is not changed. Some of the previous properties for more than two matrices generalize as follows.

1. Associative:

The matrix product is associative. If three matrices A, B, and C are respectively m × p, p × q, and q × r matrices, then there are two ways of grouping them without changing their order, and

$\mathbf{ABC} = \mathbf{A}(\mathbf{BC}) = (\mathbf{AB})\mathbf{C}$

is an m × r matrix.

If four matrices A, B, C, and D are respectively m × p, p × q, q × r, and r × s matrices, then there are five ways of grouping them without changing their order, and

$\mathbf{ABCD} = ((\mathbf{AB})\mathbf{C})\mathbf{D}=(\mathbf{A}(\mathbf{BC}))\mathbf{D}=\mathbf{A}((\mathbf{BC})\mathbf{D})=\mathbf{A}(\mathbf{B}(\mathbf{CD}))=(\mathbf{AB})(\mathbf{CD})$

is an m × s matrix.

In general, the number of possible ways of grouping n matrices for multiplication is equal to the (n − 1)th Catalan number
2. Trace:

The trace of a product of n matrices A1, A2, ..., An is invariant under cyclic permutations of the matrices in the product:

$\mathrm{tr}(\mathbf{A}_1\mathbf{A}_2\mathbf{A}_3\ldots\mathbf{A}_{n-2}\mathbf{A}_{n-1}\mathbf{A}_n) = \mathrm{tr}(\mathbf{A}_2\mathbf{A}_3\mathbf{A}_4\ldots\mathbf{A}_{n-1}\mathbf{A}_n\mathbf{A}_1) = \mathrm{tr}(\mathbf{A}_3\mathbf{A}_4\mathbf{A}_5\ldots\mathbf{A}_n\mathbf{A}_1\mathbf{A}_2) = \ldots$
3. Determinant:

For square matrices only, the determinant of a product is the product of determinants:

$\det\left(\prod_{i=1}^n \mathbf{A}_i \right) = \prod_{i=1}^n \det\left(\mathbf{A}_i\right)$

Examples of chain multiplication

Similarity transformations involving similar matrices are matrix products of the three square matrices, in the form:

$\mathbf{B} = \mathbf{P}^{-1} \mathbf{A} \mathbf{P}$

where P is the similarity matrix and A and B are said to be similar if this relation holds. This product appears frequently in linear algebra and applications, such as diagonalizing square matrices and the equivalence between different matrix representations of the same linear operator.

Operations derived from the matrix product

More operations on square matrices can be defined using the matrix product, such as powers and nth roots by repeated matrix products, the matrix exponential can be defined by a power series, the matrix logarithm is the inverse of matrix exponentiation, and so on.

Powers of matrices

Square matrices can be multiplied by themselves repeatedly in the same way as ordinary numbers, because they always have the same number of rows and columns. This repeated multiplication can be described as a power of the matrix, a special case of the ordinary matrix product. On the contrary, rectangular matrices do not have the same number of rows and columns so they can never be raised to a power. An n × n matrix A raised to a positive integer k is defined as

$\mathbf{A}^k = \underset{k \mathrm{\, times}}{\mathbf{A}\mathbf{A}\cdots\mathbf{A}}$

and the following identities hold, where λ is a scalar:

1. Zero power:
$\mathbf{A}^0 = \mathbf{I}$
where I is the identity matrix. This is parallel to the zeroth power of any number which equals unity.
2. Scalar multiplication:
$( \lambda \mathbf{A} )^k = \lambda^k\mathbf{A}^k$
3. Determinant:
$\det(\mathbf{A}^k) = \det(\mathbf{A})^k$

The naive computation of matrix powers is to multiply k times the matrix A to the result, starting with the identity matrix just like the scalar case. This can be improved using exponentiation by squaring, a method commonly used for scalars. For diagonalizable matrices, an even better method is to use the eigenvalue decomposition of A. Another method based on the Cayley–Hamilton theorem finds an identity using the matrices' characteristic polynomial, producing a more effective equation for Ak in which a scalar is raised to the required power, rather than an entire matrix.

A special case is the power of a diagonal matrix. Since the product of diagonal matrices amounts to simply multiplying corresponding diagonal elements together, the power k of a diagonal matrix A will have entries raised to the power. Explicitly;

$\mathbf{A}^k = \begin{pmatrix} A_{11} & 0 & \cdots & 0 \\ 0 & A_{22} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & A_{nn} \end{pmatrix}^k = \begin{pmatrix} A_{11}^k & 0 & \cdots & 0 \\ 0 & A_{22}^k & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & A_{nn}^k \end{pmatrix}$

meaning it is easy to raise a diagonal matrix to a power. When raising an arbitrary matrix (not necessarily a diagonal matrix) to a power, it is often helpful to exploit this property by diagonalizing the matrix first.

Applications of the matrix product

Linear transformations

Matrices offer a concise way of representing linear transformations between vector spaces, and matrix multiplication corresponds to the composition of linear transformations. The matrix product of two matrices can be defined when their entries belong to the same ring, and hence can be added and multiplied.

Let U, V, and W be vector spaces over the same field with given bases, S: VW and T: UV be linear transformations and ST: UW be their composition.

Suppose that A, B, and C are the matrices representing the transformations S, T, and ST with respect to the given bases.

Then AB = C, that is, the matrix of the composition (or the product) of linear transformations is the product of their matrices with respect to the given bases.

Linear systems of equations

A system of linear equations with the same number of equations as variables can be solved by collecting the coefficients of the equations into a square matrix, then inverting the matrix equation.

A similar procedure can be used to solve a system of linear differential equations, see also phase plane.

The inner and outer products

Given two column vectors a and b, the Euclidean inner product and outer product are the simplest special cases of the matrix product.[9]

Inner product

The inner product of two vectors in matrix form is equivalent to a column vector multiplied on the left by a row vector:

\begin{align} \mathbf{a}\cdot\mathbf{b} &=\mathbf{a}^\mathrm{T}\mathbf{b}\\ &=\begin{pmatrix}a_1 & a_2 & \cdots & a_n\end{pmatrix}\begin{pmatrix}b_1 \\ b_2 \\ \vdots \\ b_n\end{pmatrix}\\ &=a_1b_1+a_2b_2+\cdots+a_nb_n\\ &=\sum_{i=1}^n a_ib_i, \end{align}

where aT denotes the transpose of a.

The matrix product itself can be expressed in terms of inner product. Suppose that the first n × m matrix A is decomposed into its row vectors ai, and the second m × p matrix B into its column vectors bi:[1]

$\mathbf{A} = \begin{pmatrix} A_{1 1} & A_{1 2} & \cdots & A_{1 m} \\ A_{2 1} & A_{2 2} & \cdots & A_{2 m} \\ \vdots & \vdots & \ddots & \vdots \\ A_{n 1} & A_{n 2} & \cdots & A_{n m} \end{pmatrix} = \begin{pmatrix} \mathbf{a}_1 \\ \mathbf{a}_2 \\ \vdots \\ \mathbf{a}_n \end{pmatrix},$
$\mathbf{B} = \begin{pmatrix} B_{1 1} & B_{1 2} & \cdots & B_{1 p} \\ B_{2 1} & B_{2 2} & \cdots & B_{2 p} \\ \vdots & \vdots & \ddots & \vdots \\ B_{m 1} & B_{m 2} & \cdots & B_{m p} \end{pmatrix} = \begin{pmatrix} \mathbf{b}_1 & \mathbf{b}_2 & \cdots & \mathbf{b}_p \end{pmatrix}$

where

$\mathbf{a}_i = \begin{pmatrix}A_{i1} & A_{i2} & \cdots & A_{im} \end{pmatrix}\,,\quad \mathbf{b}_i = \begin{pmatrix}B_{1i} \\ B_{2i} \\ \vdots \\ B_{mi}\end{pmatrix}$

Then:

$\mathbf{AB} = \begin{pmatrix} \mathbf{a}_1 \\ \mathbf{a}_2 \\ \vdots \\ \mathbf{a}_n \end{pmatrix} \begin{pmatrix} \mathbf{b}_1 & \mathbf{b}_2 & \dots & \mathbf{b}_p \end{pmatrix} = \begin{pmatrix} (\mathbf{a}_1 \cdot \mathbf{b}_1) & (\mathbf{a}_1 \cdot \mathbf{b}_2) & \dots & (\mathbf{a}_1 \cdot \mathbf{b}_p) \\ (\mathbf{a}_2 \cdot \mathbf{b}_1) & (\mathbf{a}_2 \cdot \mathbf{b}_2) & \dots & (\mathbf{a}_2 \cdot \mathbf{b}_p) \\ \vdots & \vdots & \ddots & \vdots \\ (\mathbf{a}_n \cdot \mathbf{b}_1) & (\mathbf{a}_n \cdot \mathbf{b}_2) & \dots & (\mathbf{a}_n \cdot \mathbf{b}_p) \end{pmatrix}$

It is also possible to express a matrix product in terms of concatenations of products of matrices and row or column vectors:

$\mathbf{AB} = \begin{pmatrix} \mathbf{A}\mathbf{b}_1 & \mathbf{A}\mathbf{b}_2 & \dots & \mathbf{A}\mathbf{b}_p \end{pmatrix} = \begin{pmatrix} \mathbf{a}_1\mathbf{B} \\ \mathbf{a}_2\mathbf{B}\\ \vdots\\ \mathbf{a}_n\mathbf{B} \end{pmatrix}$

These decompositions are particularly useful for matrices that are envisioned as concatenations of particular types of row vectors or column vectors, e.g. orthogonal matrices (whose rows and columns are unit vectors orthogonal to each other) and Markov matrices (whose rows or columns sum to 1).[citation needed]

Outer product

The outer product (also known as the dyadic product or tensor product) of two vectors in matrix form is equivalent to a row vector multiplied on the left by a column vector:

\begin{align} \mathbf{a}\otimes\mathbf{b} &=\mathbf{a}\mathbf{b}^\mathrm{T}\\ &=\begin{pmatrix}a_1 \\ a_2 \\ \vdots \\ a_n\end{pmatrix} \begin{pmatrix}b_1 & b_2 & \cdots & b_n\end{pmatrix}\\ &=\begin{pmatrix} a_1 b_1 & a_1 b_2 & \cdots & a_1 b_n \\ a_2 b_1 & a_2 b_2 & \cdots & a_2 b_n \\ \vdots & \vdots & \ddots & \vdots \\ a_n b_1 & a_n b_2 & \cdots & a_n b_n \\ \end{pmatrix}. \end{align}

An alternative method is to express the matrix product in terms of the outer product. The decomposition is done the other way around, the first matrix A is decomposed into column vectors ai and the second matrix B into row vectors bi:

\begin{align} \mathbf{AB} &=\begin{pmatrix} \mathbf{\bar a}_1 & \mathbf{\bar a}_2 & \cdots & \mathbf{\bar a}_m \end{pmatrix}\begin{pmatrix} \mathbf{\bar b}_1 \\ \mathbf{\bar b}_2 \\ \vdots \\ \mathbf{\bar b}_m \end{pmatrix}\\ &=\mathbf{\bar a}_1 \otimes \mathbf{\bar b}_1 + \mathbf{\bar a}_2 \otimes \mathbf{\bar b}_2 + \cdots + \mathbf{\bar a}_m \otimes \mathbf{\bar b}_m\\ &=\sum_{i=1}^m \mathbf{\bar a}_i \otimes \mathbf{\bar b}_i \end{align}

where this time

$\mathbf{\bar a}_i = \begin{pmatrix}A_{1i} \\ A_{2i} \\ \vdots \\ A_{ni} \end{pmatrix}\,,\quad \mathbf{\bar b}_i = \begin{pmatrix}B_{i1} & B_{i2} & \cdots & B_{ip}\end{pmatrix}\,.$

This method emphasizes the effect of individual column/row pairs on the result, which is a useful point of view with e.g. covariance matrices, where each such pair corresponds to the effect of a single sample point.[citation needed]

\begin{align} \begin{pmatrix} {\color{Brown}1} & {\color{Orange}2} & {\color{Violet}3} \\ {\color{Brown}4} & {\color{Orange}5} & {\color{Violet}6} \\ {\color{Brown}7} & {\color{Orange}8} & {\color{Violet}9} \\ \end{pmatrix} \begin{pmatrix} {\color{Brown}a} & {\color{Brown}d} \\ {\color{Orange}b} & {\color{Orange}e} \\ {\color{Violet}c} & {\color{Violet}f} \\ \end{pmatrix} &= \begin{pmatrix} {\color{Brown}1} \\ {\color{Brown}4} \\ {\color{Brown}7} \\ \end{pmatrix} \begin{pmatrix} {\color{Brown}{a}} & {\color{Brown}{d}} \\ \end{pmatrix} + \begin{pmatrix} {\color{Orange}2} \\ {\color{Orange}5} \\ {\color{Orange}8}\\ \end{pmatrix} \begin{pmatrix} {\color{Orange}{b}} & {\color{Orange}{e}} \\ \end{pmatrix}+ \begin{pmatrix} {\color{Violet}3} \\ {\color{Violet}6} \\ {\color{Violet}9} \\ \end{pmatrix} \begin{pmatrix} {\color{Violet}c} & {\color{Violet}f} \\ \end{pmatrix} \\&= \begin{pmatrix} {\color{Brown}{1a}} & {\color{Brown}{1d}} \\ {\color{Brown}{4a}} & {\color{Brown}{4d}} \\ {\color{Brown}{7a}} & {\color{Brown}{7d}} \\ \end{pmatrix}+ \begin{pmatrix} {\color{Orange}{2b}} & {\color{Orange}{2e}} \\ {\color{Orange}{5b}} & {\color{Orange}{5e}} \\ {\color{Orange}{8b}} & {\color{Orange}{8e}} \\ \end{pmatrix}+ \begin{pmatrix} {\color{Violet}{3c}} & {\color{Violet}{3f}} \\ {\color{Violet}{6c}} & {\color{Violet}{6f}} \\ {\color{Violet}{9c}} & {\color{Violet}{9f}} \\ \end{pmatrix} \\&= \begin{pmatrix} {\color{Brown}{1a}} + {\color{Orange}{2b}} + {\color{Violet}{3c}} & {\color{Brown}{1d}} + {\color{Orange}{2e}} + {\color{Violet}{3f}} \\ {\color{Brown}{4a}} + {\color{Orange}{5b}} + {\color{Violet}{6c}} & {\color{Brown}{4d}} + {\color{Orange}{5e}} + {\color{Violet}{6f}} \\ {\color{Brown}{7a}} + {\color{Orange}{8b}} + {\color{Violet}{9c}} & {\color{Brown}{7d}} + {\color{Orange}{8e}} + {\color{Violet}{9f}} \\ \end{pmatrix}. \end{align}

Algorithms for efficient matrix multiplication

The bound on ω over time.

The running time of square matrix multiplication, if carried out naïvely, is O(n3). The running time for multiplying rectangular matrices (one m × p-matrix with one p × n-matrix) is O(mnp), however, more efficient algorithms exist, such as Strassen's algorithm, devised by Volker Strassen in 1969 and often referred to as "fast matrix multiplication". It is based on a way of multiplying two 2 × 2-matrices which requires only 7 multiplications (instead of the usual 8), at the expense of several additional addition and subtraction operations. Applying this recursively gives an algorithm with a multiplicative cost of $O( n^{\log_{2}7}) \approx O(n^{2.807})$. Strassen's algorithm is more complex, and the numerical stability is reduced compared to the naïve algorithm.[10] Nevertheless, it appears in several libraries, such as BLAS, where it is significantly more efficient for matrices with dimensions n > 100,[11] and is very useful for large matrices over exact domains such as finite fields, where numerical stability is not an issue.

The current O(nk) algorithm with the lowest known exponent k is a generalization of the Coppersmith–Winograd algorithm that has an asymptotic complexity of O(n2.3728639), by François Le Gall.[12] This algorithm, and the Coppersmith–Winograd algorithm on which it is based, are similar to Strassen's algorithm: a way is devised for multiplying two k × k-matrices with fewer than k3 multiplications, and this technique is applied recursively. However, the constant coefficient hidden by the Big O notation is so large that these algorithms are only worthwhile for matrices that are too large to handle on present-day computers.[13][14]

Since any algorithm for multiplying two n × n-matrices has to process all 2 × n2-entries, there is an asymptotic lower bound of Ω(n2) operations. Raz (2002) proves a lower bound of Ω(n2 log(n)) for bounded coefficient arithmetic circuits over the real or complex numbers.

Cohn et al. (2003, 2005) put methods such as the Strassen and Coppersmith–Winograd algorithms in an entirely different group-theoretic context, by utilising triples of subsets of finite groups which satisfy a disjointness property called the triple product property (TPP). They show that if families of wreath products of Abelian groups with symmetric groups realise families of subset triples with a simultaneous version of the TPP, then there are matrix multiplication algorithms with essentially quadratic complexity. Most researchers believe that this is indeed the case.[15] However, Alon, Shpilka and Chris Umans have recently shown that some of these conjectures implying fast matrix multiplication are incompatible with another plausible conjecture, the sunflower conjecture.[16]

Freivalds' algorithm is a simple Monte Carlo algorithm that given matrices A, B, C verifies in Θ(n2) time if AB = C.

Block matrix multiplication. In the 2D algorithm, each processor is responsible for one submatrix of C. In the 3D algorithm, every pair of submatrices from A and B that is multiplied is assigned to one processor.

Parallel matrix multiplication

Because of the nature of matrix operations and the layout of matrices in memory, it is typically possible to gain substantial performance gains through use of parallelization and vectorization. Several algorithms are possible, among which divide and conquer algorithms based on the block matrix decomposition

$\mathbf{C} = \begin{pmatrix} \mathbf{C}_{11} & \mathbf{C}_{12} \\ \mathbf{C}_{21} & \mathbf{C}_{22} \\ \end{pmatrix} = \begin{pmatrix} \mathbf{A}_{11} & \mathbf{A}_{12} \\ \mathbf{A}_{21} & \mathbf{A}_{22} \\ \end{pmatrix} \begin{pmatrix} \mathbf{B}_{11} & \mathbf{B}_{12} \\ \mathbf{B}_{21} & \mathbf{B}_{22} \\ \end{pmatrix} = \mathbf{A} \mathbf{B}$

that also underlies Strassen's algorithm. Here, A, B and C are presumed to be n by n (square) matrices, and C11 etc. are n/2 by n/2 submatrices. From this decomposition, one derives[17]

$\begin{pmatrix} \mathbf{A}_{11} & \mathbf{A}_{12} \\ \mathbf{A}_{21} & \mathbf{A}_{22} \\ \end{pmatrix} \begin{pmatrix} \mathbf{B}_{11} & \mathbf{B}_{12} \\ \mathbf{B}_{21} & \mathbf{B}_{22} \\ \end{pmatrix} = \begin{pmatrix} \mathbf{A}_{11} \mathbf{B}_{11} + \mathbf{A}_{12} \mathbf{B}_{21} & \mathbf{A}_{11} \mathbf{B}_{12} + \mathbf{A}_{12} \mathbf{B}_{22}\\ \mathbf{A}_{21} \mathbf{B}_{11} + \mathbf{A}_{22} \mathbf{B}_{21} & \mathbf{A}_{21} \mathbf{B}_{12} + \mathbf{A}_{22} \mathbf{B}_{22}\\ \end{pmatrix}$

which consists of eight multiplications of pairs of submatrices, which can all be performed in parallel, followed by an addition step. Applying this recursively, and performing the additions in parallel as well, one obtains an algorithm that runs in Θ(log2 n) time on an ideal machine with an infinite number of processors, and has a maximum possible speedup of Θ(n3/(log2 n)) on any real computer (although the algorithm isn't practical, a more practical variant achieves Θ(n2) speedup).[17]

It should be noted that some lower time-complexity algorithms on paper may have indirect time complexity costs on real machines.

Communication-avoiding and distributed algorithms

On modern architectures with hierarchical memory, the cost of loading and storing input matrix elements tends to dominate the cost of arithmetic. On a single machine this is the amount of data transferred between RAM and cache, while on a distributed memory multi-node machine it is the amount transferred between nodes; in either case it is called the communication bandwidth. The naïve algorithm using three nested loops uses Ω(n3) communication bandwidth.

Cannon's algorithm, also known as the 2D algorithm, partitions each input matrix into a block matrix whose elements are submatrices of size M/3 by M/3, where M is the size of fast memory.[18] The naïve algorithm is then used over the block matrices, computing products of submatrices entirely in fast memory. This reduces communication bandwidth to O(n3/M), which is asymptotically optimal (for algorithms performing Ω(n3) computation).[19][20]

In a distributed setting with p processors arranged in a p by p 2D mesh, one submatrix of the result can be assigned to each processor, and the product can be computed with each processor transmitting O(n2/p) words, which is asymptotically optimal assuming that each node stores the minimum O(n2/p) elements.[20] This can be improved by the 3D algorithm, which arranges the processors in a 3D cube mesh, assigning every product of two input submatrices to a single processor. The result submatrices are then generated by performing a reduction over each row.[21] This algorithm transmits O(n2/p2/3) words per processor, which is asymptotically optimal.[20] However, this requires replicating each input matrix element p1/3 times, and so requires a factor of p1/3 more memory than is needed to store the inputs. This algorithm can be combined with Strassen to further reduce runtime.[21] "2.5D" algorithms provide a continuous tradeoff between memory usage and communication bandwidth.[22] On modern distributed computing environments such as MapReduce, specialized multiplication algorithms have been developed.[23]

Matrix multiplication can be done cache-obliviously.

Other forms of multiplication

Some other ways to multiply two matrices are given below; some, in fact, are simpler than the definition above.

For two matrices of the same dimensions, there is the Hadamard product, also known as the element-wise product, pointwise product, entrywise product and the Schur product.[24] For two matrices A and B of the same dimensions, the Hadamard product AB is a matrix of the same dimensions, the i, j element of A is multiplied with the i, j element of B, that is:

$\left(\mathbf{A} \circ \mathbf{B}\right)_{ij} = A_{ij}B_{ij}\,,$

displayed fully:

$\mathbf{A} \circ \mathbf{B} = \begin{pmatrix} A_{11} & A_{12} & \cdots & A_{1m} \\ A_{21} & A_{22} & \cdots & A_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ A_{n1} & A_{n2} & \cdots & A_{nm} \\ \end{pmatrix}\circ\begin{pmatrix} B_{11} & B_{12} & \cdots & B_{1m} \\ B_{21} & B_{22} & \cdots & B_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ B_{n1} & B_{n2} & \cdots & B_{nm} \\ \end{pmatrix} =\begin{pmatrix} A_{11}B_{11} & A_{12}B_{12} & \cdots & A_{1m}B_{1m} \\ A_{21}B_{21} & A_{22}B_{22} & \cdots & A_{2m}B_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ A_{n1}B_{n1} & A_{n2}B_{n2} & \cdots & A_{nm}B_{nm} \\ \end{pmatrix}$

This operation is identical to multiplying many ordinary numbers (mn of them) all at once; thus the Hadamard product is commutative, associative and distributive over entrywise addition. It is also a principal submatrix of the Kronecker product. It appears in lossy compression algorithms such as JPEG.

Frobenius product

The Frobenius inner product, sometimes denoted A : B, is the component-wise inner product of two matrices as though they are vectors. It is also the sum of the entries of the Hadamard product. Explicitly,

$\mathbf{A}:\mathbf{B}=\sum_{i,j} A_{ij} B_{ij} = \mathrm{vec}(\mathbf{A})^\mathsf{T} \mathrm{vec}(\mathbf{B}) = \mathrm{tr}(\mathbf{A}^\mathsf{T} \mathbf{B}) = \mathrm{tr}(\mathbf{A} \mathbf{B}^\mathsf{T}),$

where "tr" denotes the trace of a matrix and vec denotes vectorization. This inner product induces the Frobenius norm.

Kronecker product

Main article: Kronecker product

For two matrices A and B of any different dimensions m × n and p × q respectively (no constraints on the dimensions of each matrix), the Kronecker product is the matrix

$\mathbf{A} \otimes \mathbf{B} = \begin{pmatrix} A_{11}\mathbf{B} & A_{12}\mathbf{B} & \cdots & A_{1n}\mathbf{B} \\ A_{21}\mathbf{B} & A_{22}\mathbf{B} & \cdots & A_{2n}\mathbf{B} \\ \vdots & \vdots & \ddots & \vdots \\ A_{m1}\mathbf{B} & A_{m2}\mathbf{B} & \cdots & A_{mn}\mathbf{B} \\ \end{pmatrix}.$

with dimensions mp × nq.[25] This is the application of the more general tensor product applied to matrices.

Notes

1. ^ a b Lerner, R. G.; Trigg, G. L. (1991). Encyclopaedia of Physics (2nd ed.). VHC publishers. ISBN 3-527-26954-1.
2. ^ Parker, C. B. (1994). McGraw Hill Encyclopaedia of Physics (2nd ed.). ISBN 0-07-051400-3.
3. ^ Lipschutz, S.; Lipson, M. (2009). Linear Algebra. Schaum's Outlines (4th ed.). McGraw Hill (USA). pp. 30–31. ISBN 978-0-07-154352-1.
4. ^ Riley, K. F.; Hobson, M. P.; Bence, S. J. (2010). Mathematical methods for physics and engineering. Cambridge University Press. ISBN 978-0-521-86153-3.
5. ^ Adams, R. A. (1995). Calculus, A Complete Course (3rd ed.). Addison Wesley. p. 627. ISBN 0 201 82823 5.
6. ^ Horn, Johnson (2013). Matrix Analysis (2nd ed.). Cambridge University Press. p. 6. ISBN 978 0 521 54823 6.
7. ^ Lipcshutz, S.; Lipson, M. (2009). "2". Linear Algebra. Schaum's Outlines (4th ed.). McGraw Hill (USA). ISBN 978-0-07-154352-1.
8. ^ Horn, Johnson (2013). "0". Matrix Analysis (2nd ed.). Cambridge University Press. ISBN 978 0 521 54823 6.
9. ^ Mathematical methods for physics and engineering, K.F. Riley, M.P. Hobson, S.J. Bence, Cambridge University Press, 2010, ISBN 978-0-521-86153-3
10. ^ Miller, Webb (1975), "Computational complexity and numerical stability", SIAM News 4: 97–107, doi:10.1137/0204009, CiteSeerX: 10.1.1.148.9947
11. ^ Press 2007, p. 108.
12. ^ Le Gall, François (2014), "Powers of tensors and fast matrix multiplication", Proceedings of the 39th International Symposium on Symbolic and Algebraic Computation (ISSAC 2014), arXiv:1401.7714. The original algorithm was presented by Don Coppersmith and Shmuel Winograd in 1990, has an asymptotic complexity of O(n2.376). It was improved in 2013 to O(n2.3729) by Virginia Vassilevska Williams, giving a time only slightly worse than Le Gall's improvement: Williams, Virginia Vassilevska. "Multiplying matrices faster than Coppersmith-Winograd" (PDF).
13. ^ Iliopoulos, Costas S. (1989), "Worst-case complexity bounds on algorithms for computing the canonical structure of finite abelian groups and the Hermite and Smith normal forms of an integer matrix" (PDF), SIAM Journal on Computing 18 (4): 658–669, doi:10.1137/0218045, MR 1004789, The Coppersmith–Winograd algorithm is not practical, due to the very large hidden constant in the upper bound on the number of multiplications required.
14. ^ Robinson, Sara (2005), "Toward an Optimal Algorithm for Matrix Multiplication" (PDF), SIAM News 38 (9)
15. ^ Robinson, 2005.
16. ^ Alon, Shpilka, Umans, On Sunflowers and Matrix Multiplication
17. ^ a b Randall, Keith H. (1998). Cilk: Efficient Multithreaded Computing (PDF) (Ph.D.). Massachusetts Institute of Technology. pp. 54–57.
18. ^ Lynn Elliot Cannon, A cellular computer to implement the Kalman Filter Algorithm, Technical report, Ph.D. Thesis, Montana State University, 14 July 1969.
19. ^ Hong, J.W.; Kung, H. T. (1981). "I/O complexity: The red-blue pebble game". STOC ’81: Proceedings of the thirteenth annual ACM symposium on Theory of computing: 326–333.
20. ^ a b c Irony, Dror; Toledo, Sivan; Tiskin, Alexander (September 2004). "Communication lower bounds for distributed-memory matrix multiplication". J. Parallel Distrib. Comput. 64 (9): 1017–1026. doi:10.1016/j.jpdc.2004.03.021.
21. ^ a b Agarwal, R.C.; Balle, S. M.; Gustavson, F. G.; Joshi, M.; Palkar, P. (September 1995). "A three-dimensional approach to parallel matrix multiplication". IBM J. Res. Dev. 39 (5): 575–582. doi:10.1147/rd.395.0575.
22. ^ Solomonik, Edgar; Demmel, James (2011). "Communication-optimal parallel 2.5D matrix multiplication and LU factorization algorithms". Proceedings of the 17th international conference on Parallel processing. Part II: 90–109. doi:10.1007/978-3-642-23397-5_10.
23. ^ Bosagh Zadeh, Reza; Carlsson, Gunnar. "Dimension Independent Matrix Square Using MapReduce" (PDF). Retrieved 12 July 2014.
24. ^ (Horn & Johnson 1985, Ch. 5)
25. ^ Steeb, Willi-Hans (1997), Matrix Calculus and Kronecker Product with Applications and C++ Programs, World Scientific, p. 55, ISBN 9789810232412.


text:
5

# Point) Solve the following equation for p=42p + p2 _ 9 p + 36= 0 p -3p =2Help: If there is more than one correct answer; enter your answers as a comma separated lis...

## Question

###### Point) Solve the following equation for p=42p + p2 _ 9 p + 36= 0 p -3p =2Help: If there is more than one correct answer; enter your answers as a comma separated list: If the equation has no real solution, write "none"

point) Solve the following equation for p= 4 2p + p2 _ 9 p + 3 6 = 0 p -3 p = 2 Help: If there is more than one correct answer; enter your answers as a comma separated list: If the equation has no real solution, write "none"

#### Similar Solved Questions

##### Question 5 6 marks (a) Evaluate the following SUm &s an expression in n 267-75)L -| 3n+|(b) Use part (a) to find(-25) ~1Mz
Question 5 6 marks (a) Evaluate the following SUm &s an expression in n 267-75) L -| 3n+| (b) Use part (a) to find (-25) ~1 Mz...
##### Set $= {(x, YeR x R:y-x is an integer}. 2) Prove that$ is an equivalence relation on R b) List four members of [7]: c) Which real numbers belong to [~ 17]2
Set $= {(x, YeR x R:y-x is an integer}. 2) Prove that$ is an equivalence relation on R b) List four members of [7]: c) Which real numbers belong to [~ 17]2...
##### Point) Consider the helix r(t) (cos( lt) ,sin( ~1t), 3t). Compute at t =The unit tangent vector T~sin(pil6)(sqrt((-cos(pil6) (sgrt(I3(sgrt((-sin(pi6B. The unit norma vector N = ( ~cos(pil6)(sgrt(sin(pi"6)(sart( (C. The unit binormal vector B =0.474341649020.82158383620.3162277660(D. The curvature k
point) Consider the helix r(t) (cos( lt) ,sin( ~1t), 3t). Compute at t = The unit tangent vector T ~sin(pil6)(sqrt((- cos(pil6) (sgrt(I 3(sgrt((-sin(pi6 B. The unit norma vector N = ( ~cos(pil6)(sgrt( sin(pi"6)(sart( ( C. The unit binormal vector B = 0.47434164902 0.8215838362 0.3162277660( D. ...
##### Explain differences (at least five) between innate and adaptive immunity (5 pts)
Explain differences (at least five) between innate and adaptive immunity (5 pts)...
##### 4-38 A golf [ ball is struck at ground level The speed of the golf F ball as a function of the time is shown in Fig: 4-27, where t = 0 at the instant the ball is struck: The scaling on the vertical axis is set by Va 19 mls and Vb 2 31 mls (a) How far does the golf [ ball travel horizontally be- fore returning to ground level? (b) What is the maximum height above ground level attained by the ball? n 3v1 . ` s n 4 Vb 426 112 3 t (s)Figure 4-27 Problem 38.Jat
4-38 A golf [ ball is struck at ground level The speed of the golf F ball as a function of the time is shown in Fig: 4-27, where t = 0 at the instant the ball is struck: The scaling on the vertical axis is set by Va 19 mls and Vb 2 31 mls (a) How far does the golf [ ball travel horizontally be- fore...
##### 033 (part 1 of 2) 10.0 points A hot plate connected across a potential dif- ference of 106 V has a resistance of 62 0 _ What is the current in the hot plate? Answer in units of A034 (part 2 of 2) 10.0 points A microwave oven connected across a poten - tial difference of 106 V has a resistance of 45 0 What is the current in the microwave oven? Answer in units of A
033 (part 1 of 2) 10.0 points A hot plate connected across a potential dif- ference of 106 V has a resistance of 62 0 _ What is the current in the hot plate? Answer in units of A 034 (part 2 of 2) 10.0 points A microwave oven connected across a poten - tial difference of 106 V has a resistance of 45...
##### 3. In the vector space V = Mzx2(R), define two subspaces: W = {[2 .+b] a,ber} Wa= {[9 % ader} Prove that V = W e Wz_ 4 pts
3. In the vector space V = Mzx2(R), define two subspaces: W = {[2 .+b] a,ber} Wa= {[9 % ader} Prove that V = W e Wz_ 4 pts...
##### Make a sketch of the given function on $[0, \infty)$ and express it in terms of the unit step function. $$f(t)=\left\{\begin{array}{cc}t, & 0 \leq t<3 \\6-t, & 3 \leq t<6 \\0, & t \geq 6 \end{array}\right.$$
Make a sketch of the given function on $[0, \infty)$ and express it in terms of the unit step function. $$f(t)=\left\{\begin{array}{cc}t, & 0 \leq t<3 \\6-t, & 3 \leq t<6 \\0, & t \geq 6 \end{array}\right.$$...
##### Find the limits $$\lim _{x \rightarrow 0^{+}} x \tan \left(\frac{\pi}{2}-x\right)$$
Find the limits $$\lim _{x \rightarrow 0^{+}} x \tan \left(\frac{\pi}{2}-x\right)$$...
##### Find the length of the arc y (Zx + 1)3/2,1 <x < 2.
Find the length of the arc y (Zx + 1)3/2,1 <x < 2....
##### EEleanor wants to know if running more leads to consuming Imore water: To test this, she has one group of 10 people run #or 1 mile and another group of 10 different people run for 5 Imiles. After this, she records the number of cups of water people drinkIFern wants to see if a sample of her friends' interest in playing kthe game Among Us (measured on a scale of 0 to 30) is Isignificantly higher than the population mean of other high Ischool students: They does not have the population stand
EEleanor wants to know if running more leads to consuming Imore water: To test this, she has one group of 10 people run #or 1 mile and another group of 10 different people run for 5 Imiles. After this, she records the number of cups of water people drink IFern wants to see if a sample of her friends...
##### Factor out the GCF from each polynomial. See Examples 4 through 10.$$a^{7} b^{6}-a^{3} b^{2}+a^{2} b^{5}-a^{2} b^{2}$$
Factor out the GCF from each polynomial. See Examples 4 through 10. $$a^{7} b^{6}-a^{3} b^{2}+a^{2} b^{5}-a^{2} b^{2}$$...
##### (show your work) In tlc circuit showu the figure on next pape, Uc directions of currcnts flow through thc 5 0 resistor and the unknow R Arc indicated showu If thc () resiator mensurcd to bc consuming powcr "P"ofz0 W (=p+R,VPiR, or IV) What current doca thc aneter A rcad?MMIS V s0
(show your work) In tlc circuit showu the figure on next pape, Uc directions of currcnts flow through thc 5 0 resistor and the unknow R Arc indicated showu If thc () resiator mensurcd to bc consuming powcr "P"ofz0 W (=p+R,VPiR, or IV) What current doca thc aneter A rcad? MM IS V s0...
##### Three casing (esor lcraticns coMde C Dustomens One Measutetteni SuCcese ocaion enomm one-way ANOVA using determine averaqe length say visitors Pcncnt mulliple comparison 'Es: delerinc Knich pairs arc dilferent using & = 0.05 Click the icon view Ine cata lable.Une averaae lengih slay bY visitorsaccompanying dalz shcxFe numte ol days ancam sampieinsilors Sba,edeachdifferent for the tnree ccatlcnsClick thetable crilical valuesIhe sludenlizeu rangeWhat are the correct hypothe ses = Ine one-
Three casing (esor lcraticns coMde C Dustomens One Measutetteni SuCcese ocaion enomm one-way ANOVA using determine averaqe length say visitors Pcncnt mulliple comparison 'Es: delerinc Knich pairs arc dilferent using & = 0.05 Click the icon view Ine cata lable. Une averaae lengih slay bY vis...
##### Point) The parametric form of the tangent line to the image of f(t) (3t2, % t _ 2) at t = -2is L(t) =
point) The parametric form of the tangent line to the image of f(t) (3t2, % t _ 2) at t = -2is L(t) =...
##### Below are the jersey numbers of 11 players randomly selected from football team; Find the range variance , and standard deviation for the given sample data What do the results tell us?Jersey numbers are nominal data that are just replacements for names, SO the resulting statistics are meaningless: The sample standard deviation is too large in comparison to the range_Jersey numbers on football team do not vary as much as expected_ D: Jersey numbers on football team vary much more than expected:
Below are the jersey numbers of 11 players randomly selected from football team; Find the range variance , and standard deviation for the given sample data What do the results tell us? Jersey numbers are nominal data that are just replacements for names, SO the resulting statistics are meaningless: ...

format: plain


text:
# Public Lab Research note

This is an upgrade for spectrometry. Try building it and report back how it goes.

# Spectrometer Light Tight Cover Build

by stef | 22 Oct 15:20

### What I want to do

Having removed the IR filter from my spec camera, the sensitivity increased dramatically where before the modification the spectrometer worked with the existing cover. In the new configuration the spectrometer was very sensitive to light leakage through the cover. This will work with the @stoft spec upgrades.

### My attempt and results

I cut 2 pieces of 100lb cardstock to size and a piece of heavy duty aluminum foil (not the thin stuff at the dollar store) and marked the inner lines for the bends. Don't forget the wax paper for your working surface!

I brushed on the contact cement very sparingly onto the one long edge of the cardstock and put on the aluminum foil leaving and edge exposing the paper. Brushed on more cement to the foil and attached the inside paper that was marked previously and then made a 90 degree bend.

I then bent the last 90 degree flap and brushed on sparingly the cement and glued the other side.

This is the finished cover.

### Next steps

Many may not realize that light leakage can disrupt sensitive measurement made with the spectrometer and should be aware of that possibility. I have NOT made any tests with the original spectrometer case as shipped (V03) I need to further look into the spectral bandwidth of the stock webcam without the IR filter.

### Why I'm interested

I need a stable platform to do further investigation of Ag nano particles focusing on the reflective and transmissive characteristics.

Help out by offering feedback!

### People who made this (0)

None yet. Be the first to post one!

Great build photos - I've added the upgrade:dssk tag to indicate to people that this is an upgrade that can work on the desktop spectrometer, and to prompt people to post their attempts to follow your instructions. Thanks!

Reply to this comment...

Also - do you have links to scans done with and without this light cover, in bright conditions, to show folks the advantage of additional light dampening? Thanks!

Is this a question? Click here to post it to the Questions page.

Reply to this comment...

@warren Thanks for your comments. Prior to the IR filter removal, I had no indication that there was a light transmission through the cover problem!. One can easily check as I did by wrapping the spectrometer in aluminum foil and observing any changes to the noise floor of the scan. My recent results on SW can be seen with the Cam1 NIR titles and sun sky tags. At the time I did not think to take scans of the high ambient noise levels of the scans in bright conditions. results will likely vary due to the materials used in the covers.

Reply to this comment...


text:
# Is Black-Scholes complete?

If we have a Black-Scholes model $B_t = \exp{(rt)}$ and $S_t = S_0\exp{(\sigma W_t + \mu t)}$ then is it complete?

What if $W_1$ and $W_2$ are independent Brownian motions. Then the two-stage Black-Scholes model $$B_t = \exp{(rt)}$$ $$S_1(t) = \exp{(W_1(t) + W_2(t) + t)}$$ $$S_2(t) = \exp{(W_1(t) + 2W_2(t) + 2t)}$$ is complete?

I know that we have a completeness if there is a unique martingale measure but I am not sure if this is the case for these two models.

• Why did you delete your other question ( $X=S_t^3)$ – user16651 Dec 15 '16 at 19:18
• Sorry must have been an error I'll put it back up – Wolfy Dec 15 '16 at 19:20
• My Answer was true :) – user16651 Dec 15 '16 at 19:21

Meta-theorem : Let $M$ denote the number of underlying traded assets in the model excluding the risk free asset, and let $R$ denote the number of random sources. Generically we then have the following relations
• The model is arbitrage free if and only if $M \le R$ .
• The model is complete if and only if $M \ge R$.
• The model is complete and arbitrage free if and only if $M = R$.
In the Black–Scholes model, we have one underlying asset $S_t$ plus the risk free asset so $M = 1$. Also we have one driving Wiener process, giving us $R = 1$, so in fact $M = R$.
In the second model, we have two underlying assets $S_1(t)$ and $S_2(t)$ plus the risk free asset so $M = 2$. Also we have two driving Wiener process, giving us $R = 2$, so in fact $M = R$.


text:
Question
A 75.0-kg cross-country skier is climbing a $3.0^\circ$ slope at a constant speed of 2.00 m/s and encounters air resistance of 25.0 N. Find his power output for work done against the gravitational force and air resistance. (b) What average force does he exert backward on the snow to accomplish this? (c) If he continues to exert this force and to experience the same air resistance when he reaches a level area, how long will it take him to reach a velocity of 10.0 m/s?

a) $127 \textrm{ W}$

b) $63.5 \textrm{ N}$

c) $15.6 \textrm{ s}$

Solution Video


text:
for Journals by Title or ISSN for Articles by Keywords help

Publisher: Springer-Verlag (Total: 2350 journals)

 Annals of Data Science   [11 followers]  Follow         Hybrid journal (It can contain Open Access articles)    ISSN (Print) 2198-5804 - ISSN (Online) 2198-5812    Published by Springer-Verlag  [2350 journals]
• The Improved EWMA Chart for Heteroscedasticity Process
• Authors: Dan Zhou; Liu Liu; Xin Lai
Pages: 21 - 27
Abstract: It is doubtful of the validity of the EWMA chart that the observations from heteroscedasticity processes violate the assumption of identical distribution. In this paper, we discuss the effect of heteroscedasticity on the performance of the conventional EWMA chart. Then we analyze the principle of the improved EWMA chart for monitoring heteroscedasticity processes. Then we compare the detection performance of the improved EWMA chart with the conventional EWMA chart by using a criteria based on average run length (ARL). Finally, an instance is given to indicate the effectiveness of the proposed method and analyze the best trading time of the stock.
PubDate: 2018-03-01
DOI: 10.1007/s40745-017-0133-0
Issue No: Vol. 5, No. 1 (2018)

• GPS Trajectory Clustering and Visualization Analysis
• Authors: Li Cai; Sijin Li; Shipu Wang; Yu Liang
Pages: 29 - 42
Abstract: The trajectory data of taxies containing time dimensional and spatial dimensional information is an important kind of traffic data. How to obtain valuable information from these data has become a hot topic in the field of intelligent transportation. Existing trajectory clustering algorithms can only compute similarities using partial characteristics of the trajectory data, leading to clustering results are not accurate. This study proposes a novel trajectory clustering algorithm named GLTC, which can obtain more accurate number of clusters based on the global and local characteristics of trajectories. This study intuitively displays the laws and knowledge in clustering results using visualization techniques. Experimental results reveal that the GLTC algorithm can discover more accurate clustering results, effectively display spatial-temporal change trends in GPS data, and better assist in analyzing the flow law of urban citizens and urban traffic conditions using visualization methods.
PubDate: 2018-03-01
DOI: 10.1007/s40745-017-0131-2
Issue No: Vol. 5, No. 1 (2018)

• Research and Application of GPS Trajectory Data Visualization
• Authors: Li Cai; Yifan Zhou; Yu Liang; Jing He
Pages: 43 - 57
Abstract: Taxi trajectory data is a kind of massive traffic data with spatial–temporal dimensions, and plays a key role in traffic management, travel analysis and route recommendation for residents. Analyzing trajectory data with traditional methods is complicated, but visualization techniques can intuitively reflect the change trend of spatial–temporal data and facilitate the mining of knowledge and laws in the data. A novel taxi trajectory data visualization and analysis system, TaxiVis, has been designed and developed in this study. This system not only displays the traveling routes of every taxi on the map at the micro-level, dynamically analyzing every taxi’s operating indicators with varying time, but also displays the operating statistics of every taxi company at the macro-level. In addition, the TaxiVis provides route inquiry recommendation functions for users by GLTC algorithm. Implementation of front-end functions of this system are based on Node.js, D3.js and Baidu map, and the trajectory data has been stored in MySQL database. We evaluate TaxiVis with the trajectory dataset collected from 6599 taxis in Kunming. Experimental results show that the system can effectively process and analyze trajectory data, and provide precise data supporting and presentation for the comprehensive evaluation of taxi operation efficiency and mining the drivers’ intelligence.
PubDate: 2018-03-01
DOI: 10.1007/s40745-017-0132-1
Issue No: Vol. 5, No. 1 (2018)

• Reliability Estimation in Load-Sharing System Model with Application to
Real Data
• Authors: Pramendra Singh Pundir; Puneet Kumar Gupta
Pages: 69 - 91
Abstract: This study deals with the reliability analysis of a multi-component load sharing system where failure of any component within the system induces higher failure rate on the remaining surviving components. It is assumed that each component failure time follows Chen distribution. In classical set up, the maximum likelihood estimates of the load sharing parameters, system reliability and hazard rate along with their standard errors are computed. Since maximum likelihood estimates are not in closed form, so asymptotic confidence intervals and two bootstrap confidence intervals for the unknown parameters have also been constructed. Further, by assuming both informative and non-informative prior for the unknown parameters, Bayes estimates along with their posterior standard errors and HPD intervals of the parameters are obtained. Thereafter, a simulation study elicitates the theoretical developments. A real data analysis, at the end, eshtablishes the applicability of the proposed theory.
PubDate: 2018-03-01
DOI: 10.1007/s40745-017-0120-5
Issue No: Vol. 5, No. 1 (2018)

• Power Lindley-G Family of Distributions
• Authors: Amal S. Hassan; Said G. Nassr
Abstract: In this paper, we introduce a new family of probability distributions generated from a power Lindley random variable called the power Lindley-generated family. The new family extends several classical distributions as well as generalizes the odd Lindley family which is performed by Silva et al. (Austrian J Stat 46:65–87, 2017). Some of the mathematical properties are obtained involving moments, incomplete moments, quantile function and order statistics. New four distributions are provided as special models from the family. The model parameters of the family are estimated by the maximum likelihood technique. An application to real data set and simulation study are provided to demonstrate the flexibility and interest of one special model of the suggested family.
PubDate: 2018-03-16
DOI: 10.1007/s40745-018-0159-y

• Statistical Inference and Optimum Life Testing Plans Under Type-II Hybrid
Censoring Scheme
• Authors: Tanmay Sen; Yogesh Mani Tripathi; Ritwik Bhattacharya
Abstract: This article considers estimation of unknown parameters and prediction of future observations of a generalized exponential distribution based on Type-II hybrid censored data. Bayes point and HPD interval estimates of the unknown parameters are obtained under the assumption of independent gamma priors. Different classical and Bayesian point predictors and prediction intervals are obtained in two-sample situation against squared error loss function. The optimum censoring schemes are computed under various optimality criteria. Monte Carlo simulations are performed to compare different methods and two data sets are analyzed for illustrative purposes.
PubDate: 2018-03-14
DOI: 10.1007/s40745-018-0158-z

• Forecasting the Volatility of Ethiopian Birr/Euro Exchange Rate Using
Garch-Type Models
• Authors: Desa Daba Fufa; Belianeh Legesse Zeleke
Abstract: This paper provides a robust analysis of volatility forecasting of Euro-ETB exchange rate using weekly data spanning the period January 3, 2000–December 2, 2015. The forecasting performance of various GARCH-type models is investigated based on forecasting performance criteria such as MSE and MAE based tests, and alternative measures of realized volatility. To our knowledge, this is the first study that focuses on Euro-ETB exchange rate using high frequency data, and a range of econometric models and forecast performance criteria. The empirical results indicate that the Euro-ETB exchange rate series exhibits persistent volatility clustering over the study period. We document evidence that ARCH (8), GARCH (1, 1), EGARCH (1, 1) and GJR-GARCH (2, 2) models with normal distribution, student’s-t distribution and GED are the best in-sample estimation models in terms of the volatility behavior of the series. Amongst these models, GJR-GARCH (2, 2) and GARCH (1, 1) with students t-distribution are found to perform best in terms of one step-ahead forecasting based on realized volatility calculated from the underlying daily data and squared weekly first differenced of the logarithm of the series, respectively. A one-step-ahead forecasted conditional variance of weekly Euro-ETB exchange rate portrays large spikes around 2010 and it is evident that weekly Euro-ETB exchange rate are volatile. This large spikes indicates that devaluation of Ethiopian birr against the Euro. This volatility behavior may affects the International Foreign Investment and trade balance of the country. Therefore, GJR-GARCH (2, 2) with student’s t-distribution is the best model both interms of the stylized facts and forecasting performance of the volatility of Ethiopian Birr/Euro exchange rate among others.
PubDate: 2018-03-13
DOI: 10.1007/s40745-018-0151-6

• Joint Modeling of Longitudinal CD4 Count and Time-to-Death of HIV/TB
Co-infected Patients: A Case of Jimma University Specialized Hospital
• Authors: Aboma Temesgen; Abdisa Gurmesa; Yehenew Getchew
Abstract: Tuberculosis (TB) and HIV have been closely linked since the emergence of AIDS; TB enhances HIV replication by accelerating the natural evolution of HIV infection which is the leading cause of sickness and death of peoples living with HIV/AIDS. To improve their life the co-infected patients are started to take antiretroviral treatment as patient started to take ART it is common to measure CD4 and other clinical outcomes which is correlated with survival time. However, the separate analysis of such data does not handle the association between the longitudinal measured out come and time-to-event where the joint modeling does to obtain valid and efficient survival time. Joint modeling of longitudinally measured CD4 and time-to death to understand their association. Furthermore, the study identifies factors affecting the mean change in square root CD4 measurement over time and risk factors for the survival time of HIV/TB co-infected patients. The study consists of 254 HIV/TB co-infected patients who were 18 years old or older and who were on antiretroviral treatment follow up from first February 2009 to fist July 2014 in Jimma University Specialized Hospital, West Ethiopia. First, data were analyzed using linear mixed model and survival models separately. After having appropriate separate models using Akaki information criteria, different joint models employed with different random effects longitudinal model and different shared parameters association structure of survival model and compared with deviance information criteria score. The linear mixed model showed functional status, weight, linear time and quadratic time effects have significant effect on the mean change of CD4 measurement over time. The Cox and Weibull survival model showed base line weight, baseline smoking, separated marital status group and base line functional status have significant effect on hazard function of the survival time whereas the joint model showed subject specific base line value; subject specific linear and quadratic slopes of CD4 measurement of were significantly associated with the survival time of co-infected patient at 5% significance levels. The longitudinally measured CD4 count measurement marker process is significantly associated with time to death and subject specific quadratic slope growth of CD4 measurement, base line clinical stage IV and smoking is the high risk factors that lower the survival time of HIV/TB co-infected patients. Since the longitudinally measured CD4 measurement is correlated with survival time joint modeling are used to handle the associations between these two processes to obtain valid and efficient survival time.
PubDate: 2018-03-12
DOI: 10.1007/s40745-018-0157-0

• Transmuted Kumaraswamy Quasi Lindley Distribution with Applications
• Authors: M. Elgarhy; I. Elbatal; Muhammad Ahsan ul Haq; Amal S. Hassan
Abstract: The Lindley distribution is one of the widely used models for studying most of reliability modeling. Besides, several of researchers have motivated new classes of distributions based on modifications of the quasi Lindley distribution. In this article, a new version of generalized distributions named as the transmuted Kumaraswamy quasi Lindley (TKQL) is introduced. Various statistical properties of the TKQL distribution are provided. The rth moment of the TKQL distribution and its moment generating function are explored. Moreover, estimation of the model parameters is discussed via the method of maximum likelihood. Applications to real data are performed to clarify the flexibility of the TKQL distribution in comparison with some sub-models.
PubDate: 2018-03-12
DOI: 10.1007/s40745-018-0153-4

• Fractal Dimension Calculation for Big Data Using Box Locality Index
• Authors: Rong Liu; Robert Rallo; Yoram Cohen
Abstract: The box-counting approach for fractal dimension calculation is scaled up for big data using a data structure named box locality index (BLI). The BLI is constructed as key-value pairs with the key indexing the location of a “box” (i.e., a grid cell on the multi-dimensional space) and the value counting the number of data points inside the box (i.e., “box occupancy”). Such a key-value pair structure of BLI significantly simplifies the traditionally used hierarchical structure and encodes only necessary information required by the box-counting approach for fractal dimension calculation. Moreover, as the box occupancies (i.e., the values) associated with the same index (i.e., the key) are aggregatable, the BLI grants the box-counting approach the needed scalability for fractal dimension calculation of big data using distributed computing techniques (e.g., MapReduce and Spark). Taking the advantage of the BLI, MapReduce and Spark methods for fractal dimension calculation of big data are developed, which conduct box-counting for each grid level as a cascade of MapReduce/Spark jobs in a bottom-up fashion. In an empirical validation, the MapReduce and Spark methods demonstrated good effectiveness and efficiency in fractal calculation of a big synthetic dataset. In summary, this work provides an efficient solution for estimating the intrinsic dimension of big data, which is essential for many machine learning methods and data analytics including feature selection and dimensionality reduction.
PubDate: 2018-03-10
DOI: 10.1007/s40745-018-0152-5

• Artificial Neural Network Classification of High Dimensional Data with
Novel Optimization Approach of Dimension Reduction
• Authors: Rabia Aziz; C. K. Verma; Namita Srivastava
Abstract: Classification of high dimensional data is a very crucial task in bioinformatics. Cancer classification of the microarray is a typical application of machine learning due to the large numbers of genes. Feature (genes) selection and classification with computational intelligent techniques play an important role in diagnosis and prediction of disease in the microarray. Artificial neural networks (ANN) is an artificial intelligence technique for classifying, image processing and predicting the data. This paper evaluates the performance of ANN classifier using six different hybrid feature selection techniques, for gene selection of microarray data. These hybrid techniques use Independent component analysis (ICA), as an extraction technique, popular filter techniques and bio-inspired algorithm for optimization of the ICA feature vector. Five binary gene expression microarray datasets are used to compare the performance of these techniques and determine how these techniques improve the performance of ANN classifier. These techniques can be extremely useful in feature selection because they achieve the highest classification accuracy along with the lowest average number of selected genes. Furthermore, to check the significant difference between these different algorithms a statistical hypothesis test was employed with a certain level of confidence. The experimental result shows that a combination of ICA with genetic bee colony algorithm shows superior performance as it heuristically removes non-contributing features to improve the performance of classifiers.
PubDate: 2018-03-09
DOI: 10.1007/s40745-018-0155-2

• On Optimal Progressive Censoring Schemes for Normal Distribution
• Authors: U. H. Salemi; S. Rezaei; Y. Si; S. Nadarajah
Abstract: Selection of optimal progressive censoring schemes for the normal distribution is discussed according to maximum likelihood estimation and best linear unbiased estimation. The selection is based on variances of the estimators of the two parameters of the normal distribution. The extreme left censoring scheme is shown to be an optimal progressive censoring scheme. The usual type-II right censoring case is shown to be the worst progressive censoring scheme for estimating the scale parameter. It can greatly increase the variance of estimators.
PubDate: 2018-03-09
DOI: 10.1007/s40745-018-0156-1

• A Novel Multiview Topic Model to Compute Correlation of Heterogeneous Data
• Authors: Jinsheng Shen; Mingmin Chi
Abstract: With fast development of Internet technologies and sensor techniques, it is much easier to acquire data from different sources in different dates and times. However, how to compute the correlation of those heterogeneous data is a big challenge for data mining and information retrieval. Here, data feature from one source is called as a view, and the multiview features denote the same data point. In the paper, hidden correlation of two-view features is proposed to construct a Heterogeneous (multiview) Topic Model (HTM). In particular, probabilistic topic model is utilized for different views as usually, generative models provide much richer features when handling high-dimensional data such as texts. Nevertheless, it is necessary to know the form of probability distribution for most existent probabilistic topic models, such as latent Dirichlet allocation. By avoiding the limitation of probabilistic topic model, the HTM is reduced to solving a non-negative matrix tri-factorization problem with certain constraints such that the proposed approach can be used in terms of an arbitrary model.
PubDate: 2018-02-20
DOI: 10.1007/s40745-017-0135-y

• Assessing Survival Time of Women with Cervical Cancer Using Various
Parametric Frailty Models: A Case Study at Tikur Anbessa Specialized
• Authors: Selamawit Endale Gurmu
Abstract: Cervical cancer is one of the leading causes of death in the world and represents a tremendous burden on patients, families and societies. It is estimated that over one million women worldwide currently have cervical cancer; most of them have not been diagnosed or have no access to treatment that could cure them or prolong their lives. The goal of this study is to investigate potential risk factors affecting survival time of women with cervical cancer at Tikur Anbessa specialized hospital. Data were taken from patients’ medical record card that enrolled during September 2011–September 2015. Kaplan–Meier estimation method, Cox proportional hazard model and parametric shared frailty model were used to analysis survival time of cervical cancer patients. Study subjects (cervical cancer patients) in this study came from clustered community and hence clustered survival data correlated at the regional level. Parametric frailty models will be explored assuming that women with in the same cluster (region for this study) shares similar risk factors. We used Exponential, Weibull, Log logistics and Log normal distributions and based on AIC criteria, all models were compared for their performance. The lognormal inverse Gaussian model has the minimum AIC value among the models compared. The results implied that not giving birth up to the study ends and married after twenty years were significantly prolong the survival time of patients while age class 51–60, 61–70, > 70, smoking cigarettes, patients with stage III and IV disease, family history of cervical cancer, history of abortion and living with HIV AIDS were significantly shorten survival time of patients. The findings of this study suggested that age, smoking cigarettes, stage, family history, abortion history, living with HIV AIDS, age at first marriage and age at first birth were major factors to survival time of patients. Heterogeneity between the regions in the survival time of cervical cancer patients, indicating that one needs to account for this clustering variable using frailty models. The fit statistics showed that lognormal inverse-Gaussian frailty model described the survival time of cervical cancer patients dataset better than other distributions used in this study.
PubDate: 2018-02-17
DOI: 10.1007/s40745-018-0150-7

• Build a Tourism-Specific Sentiment Lexicon Via Word2vec
• Authors: Wei Li; Luyao Zhu; Kun Guo; Yong Shi; Yuanchun Zheng
Abstract: Online travel and online travel culture developed fast in China recently years while useful knowledge still hidden under a large number of tourism reviews. Therefore, we need effective sentiment analysis methods to mine useful knowledge which can help tourism websites make decisions and improve their travel products. Some data-driven sentiment lexicons have poor performance on sentiment polarity classification due to lack of semantic information. Thus, we propose an effective and more proper data-driven sentiment lexicon construction method incorporating manually labeled sentiment scores, semantic similarity information that is introduced by machine learning method word2vec. Experimental results demonstrate that our method improves the performance of tourism sentiment analysis significantly.
PubDate: 2018-02-16
DOI: 10.1007/s40745-017-0130-3

• User Data Can Tell Defaulters in P2P Lending
• Authors: Jackson J. Mi; Tianxiao Hu; Luke Deer
Abstract: Online peer-to-peer (P2P) lending service is a new type of financial platforms that enables individuals borrow and lend money directly from one to another. As P2P lending service is rapidly developing, a number of rating systems of borrowers’ creditworthiness are published by different P2P lending companies. However, whether these rating systems could truly reflect the creditworthiness and loan risk of borrowers is unconfirmed. In this paper, we analyzed the differences between credit levels and users’ distribution of CPLP to evaluate if the credit levels can truly reflect the borrowers’ credit. We used soft factors to establish a model that can find borrowers who are likely to default. Further, we proposed some strategies to construct and improve the risk-control of P2P lending platforms according to the result of our research.
PubDate: 2018-02-05
DOI: 10.1007/s40745-017-0134-z

• Enhancing Situation Awareness Using Semantic Web Technologies and Complex
Event Processing
• Authors: Havva Alizadeh Noughabi; Mohsen Kahani; Alireza Shakibamanesh
Abstract: Data fusion techniques combine raw data of multiple sources and collect associated data to achieve more specific inferences than what could be attained with a single source. Situational awareness is one of the levels of the JDL, a matured information fusion model. The aim of situational awareness is to understand the developing relationships of interests between entities within a specific time and space. The present research shows how semantic web technologies, i.e. ontology and semantic reasoner, can be used to describe situations and increase awareness of the situation. As the situation awareness level receives data streams from numerous distributed sources, it is necessary to manage data streams by applying data stream processor engines such as Esper. In addition, in this research, complex event processing, a technique for achieving related situational in real-time, has been used, whose main aim is to generate actionable abstractions from event streams, automatically. The proposed approach combines Complex Event Processing and semantic web technologies to achieve better situational awareness. To show the functionality of the proposed approach in practice, some simple examples are discussed.
PubDate: 2018-02-05
DOI: 10.1007/s40745-018-0148-1

• A New Family of Generalized Distributions Based on Alpha Power
Transformation with Application to Cancer Data
• Authors: M. Nassar; A. Alzaatreh; O. Abo-Kasem; M. Mead; M. Mansoor
Abstract: In this paper, we propose a new method for generating distributions based on the idea of alpha power transformation introduced by Mahdavi and Kundu (Commun Stat Theory Methods 46(13):6543–6557, 2017). The new method can be applied to any distribution by inverting its quantile function as a function of alpha power transformation. We apply the proposed method to the Weibull distribution to obtain a three-parameter alpha power within Weibull quantile function. The new distribution possesses a very flexible density and hazard rate function shapes which are very useful in cancer research. The hazard rate function can be increasing, decreasing, bathtub or upside down bathtub shapes. We derive some general properties of the proposed distribution including moments, moment generating function, quantile and Shannon entropy. The maximum likelihood estimation method is used to estimate the parameters. We illustrate the applicability of the proposed distribution to complete and censored cancer data sets.
PubDate: 2018-02-03
DOI: 10.1007/s40745-018-0144-5

• $$\ell _1$$ ℓ 1 -Norm Based Central Point Analysis for Asymmetric Radial
Data
• Authors: Qi An; Shu-Cherng Fang; Tiantian Nie; Shan Jiang
Abstract: Multivariate asymmetric radial data clouds with irregularly positioned “spokes” and “clutters” are commonly seen in real life applications. In identifying the spoke directions of such data, a key initial step is to locate a central point from which each spoke extends and diverges. In this technical note, we propose a novel method that features a preselection procedure to screen out candidate points that have sufficiently many data points in the vicinity and identifies the central point by solving an $$\ell _1$$ -norm constrained discrete optimization program. Extensive numerical experiments show that the proposed method is capable of providing central points with superior accuracy and robustness compared with other known methods and is computationally efficient for implementation.
PubDate: 2018-01-29
DOI: 10.1007/s40745-018-0147-2

• Ranking of Classification Algorithms in Terms of Mean–Standard
Deviation Using A-TOPSIS
• Authors: André G. C. Pacheco; Renato A. Krohling
Abstract: In classification problems when multiple algorithms are applied to different benchmarks a difficult issue arises, i.e., how can we rank the algorithms' In machine learning, it is common to run the algorithms several times and then a statistic is calculated in terms of means and standard deviations. In order to compare the performance of the algorithms, it is very common to employ statistical tests. However, these tests may also present limitations, since they consider only the means and not the standard deviations of the obtained results. In this paper, we present the so-called A-TOPSIS, based on Technique for Order Preference by Similarity to Ideal Solution (TOPSIS), to solve the problem of ranking and comparing classification algorithms in terms of means and standard deviations. We use two case studies to illustrate the A-TOPSIS for ranking classification algorithms and the results show the suitability of A-TOPSIS to rank the algorithms. The presented approach can be applied to compare the performance of stochastic algorithms in machine learning. Lastly, to encourage researchers to use the A-TOPSIS for ranking algorithms, we also presented in this work an easy-to-use A-TOPSIS web framework.
PubDate: 2018-01-13
DOI: 10.1007/s40745-018-0136-5

JournalTOCs
School of Mathematical and Computer Sciences
Heriot-Watt University
Edinburgh, EH14 4AS, UK
Email: journaltocs@hw.ac.uk
Tel: +00 44 (0)131 4513762
Fax: +00 44 (0)131 4513327

Home (Search)
Subjects A-Z
Publishers A-Z
Customise
APIs


text:
# Does something like \rowcolors exist for groups of rows?

I need to find a package or else learn how to make a tex command definition that does something very similar to the \rowcolors command for tables, for creating a table with alternating background color stripes, but with a couple of key differences.

First, although this is largely cosmetic, I would very much like the content of a cell to be vertically centered in the background. I notice that \rowcolor tends to leave a larger margin at the bottom than it does at the top, and this looks weird when you have a striped table. All the text seems to be offset vertically from where it is looks like it should be.

More importantly, I want to be able to define the size of the group of row to color, so that unlike \rowcolors where it alternates between two backgrounds each and every row, I want to be able to specify how many rows to group together. So while \rowcolors would effective use a group size of only 1 row, I would like to be able to specify groups of two, three or four rows to group together, for example, and so alternate colors every two, three, or four rows, respectively. This question, which I initially thought was asking the exact same question I am, requires much more explicit coding throughout the table than what I was hoping for, where I was wanting something where I could easily just define all of my tables normally, and then easily go back to it and specify alternating color groups on the tables that needed it (as well as the size of the group to use for the table, of course). The aforementioned question I have linked to here seems to require that I explicitly mark the start of each group, and uses an additional command to actually generate each individual row.

I need the ability to specify which row of a table to start alternating the colors on, as well as a way to have different sizes of groups for different tables (or to turn it off completely). Whether this is done before the table starts or embedded into the row where the alternating colors begin is not important.

It is also of great importance to me that the solution must have a single solid block of unbroken color across all adjacent rows and columns with the same background specified. That is, there can be no thin bars of the normal page background separating the columns or rows. I mention this because I have seen both \rowcolor and \columncolor exhibit this behavior, although I have come to believe that this may be a matter of which tool I am using to render the resulting pdf.

If I have to define my own command for this, I'm going to have no idea how to begin. I'm a complete TeX newbie here, so I'm really hoping that either this already exists out there somewhere, or else it's easy enough to do that it could be explained simply here.

I have taken a look at the code for \rowcolors and adapted it to allow groups greater one. The new command \groupedRowColors takes four mandatory and one optional argument:

• The first mandatory argument is the group size, the number of consecutive lines to have the same color.
• The second mandatory argument is the start line, all lines above will not be colored. This is useful to exclude a header.
• The third and fourth mandatory arguments are the colors to be used.

If you do not like where the grouping starts or would like to start with the other color you can use the optional argument to shift the colors. Please note that integer division in \numexpr rounds the result so the required shift may be different from what one might expect. (See this question.)

\documentclass{article}

\usepackage[table]{xcolor}
\usepackage{booktabs}

\makeatletter
\newcommand{\groupedRowColors}[5][0]{% [#1: offset], #2: group size, #3: start line, #4: color 1, #5: color 2
% copied from xcolor.sty
\global\rownum=\z@
\global\@rowcolorstrue
\@ifxempty{#4}%
{\def\@oddrowcolor{\@norowcolor}}%
{\def\@oddrowcolor{\gdef\CT@row@color{\CT@color{#4}}}}%
\@ifxempty{#5}%
{\def\@evenrowcolor{\@norowcolor}}%
{\def\@evenrowcolor{\gdef\CT@row@color{\CT@color{#5}}}}%
% simplified (no check for \if@rowcmd)
\def\@rowcolors{%
\if@rowcolors
\noalign{%
\relax
\ifnum\rownum<#3
\@norowcolor
% I have changed this check:
\else \ifodd \numexpr (\rownum-#1)/#2\relax
\@oddrowcolor
\else
\@evenrowcolor
\fi \fi
}%
\fi
}%
\CT@everycr{\@rowc@lors\the\everycr}%
\ignorespaces
}
\makeatother

\begin{document}
\groupedRowColors{3}{2}{green!10}{blue!10}
\begin{tabular}{cc}
\toprule
Column~1 & Column~2 \\
\midrule
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
\bottomrule
\end{tabular}
\end{document}

EDIT: example with longtable

\documentclass{article}
\usepackage[a6paper, landscape]{geometry}

\usepackage[table]{xcolor}
\usepackage{booktabs}
\usepackage{longtable}

\makeatletter
\newcommand{\groupedRowColors}[5][0]{% [#1: offset], #2: group size, #3: start line, #4: color 1, #5: color 2
% copied from xcolor.sty
\global\rownum=\z@
\global\@rowcolorstrue
\@ifxempty{#4}%
{\def\@oddrowcolor{\@norowcolor}}%
{\def\@oddrowcolor{\gdef\CT@row@color{\CT@color{#4}}}}%
\@ifxempty{#5}%
{\def\@evenrowcolor{\@norowcolor}}%
{\def\@evenrowcolor{\gdef\CT@row@color{\CT@color{#5}}}}%
% simplified (no check for \if@rowcmd)
\def\@rowcolors{%
\if@rowcolors
\noalign{%
\relax
\ifnum\rownum<#3
\@norowcolor
% I have changed this check:
\else \ifodd \numexpr (\rownum-#1)/#2\relax
\@oddrowcolor
\else
\@evenrowcolor
\fi \fi
}%
\fi
}%
\CT@everycr{\@rowc@lors\the\everycr}%
\ignorespaces
}
\makeatother

\begin{document}
\groupedRowColors{3}{0}{green!10}{blue!10}
\begin{longtable}{ c c }
\hiderowcolors
\toprule
Column~1 & Column~2 \\
\midrule
Column~1 & Column~2 \\
\midrule
\midrule
\multicolumn{2}{r@{}}{\footnotesize(to be continued on next page)}
\endfoot
\bottomrule
\endlastfoot
\showrowcolors
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
(\the\rownum,0) & (\the\rownum,1) \\
\end{longtable}
\end{document}

(The definition of \groupedRowColors is unchanged.)

• It took a little bit of fudging with the start line and shift arguments to get the look that I want, but otherwise this is almost exactly right. The only thing I needed to change to get the exact look I was after is the expression in the condition, which I changed to read as: '((\rownum-#3)/#2)-#1' instead of '(\rownum-#1)/#2' – Mark Oct 13 '17 at 12:35
• Hmmm... I see that this doesn't work when I have a longtable with rows that are supposed to be at the head of each page. Ideally, a solution should also start the row count from 0 at the beginning of each new page. – Mark Oct 14 '17 at 21:05
• @Mark I don't know a possibility to reset the row count at a page break. \global\rownum=0 between \endfirsthead and \endhead does not work. – jakun Oct 15 '17 at 7:34

The environment {NiceTabular} of nicematrix provides tools to color cells, rows and columns. The resultat is very good in all the PDF viewers, at all levels of zoom.

\documentclass{article}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{nicematrix}

\begin{document}
\begin{NiceTabular}{cc}%
[
code-before = \rowcolor{green!10}{2-4,8-10,14-15}
\rowcolor{blue!10}{5-7,11-13}
]
\toprule
Column~1 & Column~2 \\
\midrule
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
\bottomrule
\end{NiceTabular}
\end{document}

However you need several compilations (because nicematrix uses PGF/Tikz nodes) and nicematrix is not compatible with longtable.

It's also possible to write a command \MyColorRows to do the job automatically.

The following command \MyColorRows takes in four arguments:

• the number of the first colored row (in the example 2) ;
• the number of successives row to color with the same color (in the example 3) ;
• the first color ;
• the second color.

The command \MyColorRows must be used in the code-before (as does \rowcolor of nicematrix).

\documentclass{article}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{nicematrix}

\ExplSyntaxOn
\NewDocumentCommand \MyRowColors { m m m m }
{
\int_step_inline:nnn { #1 } { \value { iRow } }
{
\int_if_even:nTF { \int_div_truncate:nn { ##1 - #1 } { #2 } }
{ \rowcolor { #3 } { ##1 } }
{ \rowcolor { #4 } { ##1 } }
}
}
\ExplSyntaxOff

\begin{document}
\begin{NiceTabular}{cc}[code-before = \MyRowColors{2}{3}{green!10}{blue!10}]
\toprule
Column~1 & Column~2 \\
\midrule
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
(\arabic{iRow},0) & (\arabic{iRow},1) \\
\bottomrule
\end{NiceTabular}
\end{document}

The output is the same.