Learn R Programming

Boom (version 0.9.15)

traceproduct: Trace of the Product of Two Matrices

Description

Returns the trace of the product of two matrices.

Usage

TraceProduct(A, B, b.is.symmetric = FALSE)

Value

Returns a number equivalent to sum(diag(A %*% B)).

Arguments

A

The first matrix in the product.

B

The second matrix in the product.

b.is.symmetric

Logical. A TRUE value indicates that B is a symmetric matrix. A slight computational savings is possible if B is symmetric.

Author

Steven L. Scott steve.the.bayesian@gmail.com