traceproduct {Boom}R Documentation

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)

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.

Value

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

Author(s)

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


[Package Boom version 0.9.15 Index]