R/SUMPCAnormCP.R

Defines functions SUMPCAnormCP

Documented in SUMPCAnormCP

#' @title SUMPCAnormCP
#' @description Normalizes a positive semi-definite matrix (i.e., total intertia=1)
#' @param Y Matrix to normalize
#' @return Normalized matrix
#' @examples 
#' \donttest{
#' A <- toeplitz(c(1, 0.6))
#' SUMPCAnormCP(A)
#' }
#' @rdname SUMPCAnormCP
#' @export 
SUMPCAnormCP <- function(Y) {
    Ynormed <- Y / sum(diag(Y))
    return(Ynormed)
} 

Try the DistatisR package in your browser

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

DistatisR documentation built on Dec. 5, 2022, 9:05 a.m.