Learn R Programming

lmreg (version 1.3)

tr: Trace of matrix

Description

Computes the trace of a given matrix.

Usage

tr(M)

Value

A scalar value, describing the trace of M.

Arguments

M

A matrix whose trace is to be computed.

Author

Debasis Sengupta <shairiksengupta@gmail.com>, Jinwen Qiu <qjwsnow_ctw@hotmail.com>

References

Sengupta and Jammalamadaka (2019), Linear Models and Regression with R: An Integrated Approach.

Examples

Run this code
tr(matrix(2,2,2))

Run the code above in your browser using DataLab