Learn R Programming

fastmatrix (version 0.5-7721)

bracket.prod: Bracket product

Description

Bracket product of a matrix and a 3-dimensional array.

Usage

bracket.prod(a, x)

Value

bracket.prod returns a 3-dimensional array of dimension \(m\times p\times q\).

Arguments

a

a numeric matrix.

x

a three-dimensional array.

Details

Let \(\bold{X} = (x_{tij})\) be a 3-dimensional \(n\times p\times q\) array and \(\bold{A}\) an \(m\times n\) matrix, then \(\bold{Y} = [\bold{A}][\bold{X}]\) is called the bracket product of \(\bold{A}\) and \(\bold{X}\), that is an \(m \times p\times q\) with elements $$y_{tij} = \sum\limits_{k=1}^n a_{tk}x_{kij}$$

References

Wei, B.C. (1998). Exponential Family Nonlinear Models. Springer, New York.

See Also

array, matrix, array.mult.

Examples

Run this code
x <- array(0, dim = c(2,3,3)) # 2 x 3 x 3 array
x[,,1] <- c(1,2,2,4,3,6)
x[,,2] <- c(2,4,4,8,6,12)
x[,,3] <- c(3,6,6,12,9,18)

a <- matrix(1, nrow = 3, ncol = 2)

y <- bracket.prod(a, x) # a 3 x 3 x 3 array
y

Run the code above in your browser using DataLab