R/utils.R

Defines functions Trace

## --- Trace

Trace = function(A) {
  if (is.matrix(A)) {
    if (nrow(A) != ncol(A)) {
      stop('Matrix should be square in Trace()')
    }
  }
  return(sum(diag(A)))
}

Try the FisherEM package in your browser

Any scripts or data that you put into this service are public.

FisherEM documentation built on Oct. 23, 2020, 8:08 p.m.