tr: Trace operator

trR Documentation

Trace operator

Description

Calculates the trace of a square matrix.

Usage

tr(x, ...)

Arguments

x

Square numeric matrix

...

Additional arguments to lower level functions

Value

numeric

Author(s)

Klaus K. Holst

See Also

crossprod, tcrossprod

Examples


tr(diag(1:5))

kkholst/lava documentation built on Jan. 13, 2025, 12:34 p.m.