Learn R Programming

varComp (version 0.2-0)

normalizeTrace: Rescales a square matrix such that the trace is the same as the dimension

Description

Rescales a square matrix such that the trace is the same as the dimension.

Usage

normalizeTrace(x)

Arguments

x

A square numeric matrix to be rescaled.

Value

A numeric matrix.

Details

This is computed as {x=as.matrix(x); x/mean(diag(x))}.

See Also

base::diag

Examples

Run this code
# NOT RUN {
	set.seed(3456L)
	A=tcrossprod(runif(10L))
	A0 = normalizeTrace(A)
	sum(diag(A0)) - nrow(A)
	
# }

Run the code above in your browser using DataLab