Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

matrix-tr

Trace of a Matrix


Description

Returns trace of a matrix.

Usage

tr(x)

Arguments

x

a numeric matrix.

Details

The function tr computes the trace of a square matrix which is the sum of the diagonal elements of the matrix under consideration.

References

Golub, van Loan, (1996); Matrix Computations, 3rd edition. Johns Hopkins University Press.

Examples

## Create Pascal Matrix:
   P = pascal(3)
   P
  
## Trace:
   tr(P)

fBasics

Rmetrics - Markets and Basic Statistics

v3042.89.1
GPL (>= 2)
Authors
Diethelm Wuertz [aut], Tobias Setz [cre], Yohan Chalabi [ctb] Martin Maechler [ctb]
Initial release
2017-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.