R/cholcovs.R

Defines functions cholcovs

Documented in cholcovs

#' cholcovs
#'
#' @param X A matrix of data.
#' @param use the missing data type to use for the correlation. Default is R's default "everything".
#'
#' @return This function returns the cholesky decomposition of the correlation matrix of the data
#' @import stats
#' @export
#'
#' @examples X<-stats::rnorm(100)
#' Y<-stats::rnorm(100)+X
#' Z<-cbind(X,Y)
#' cholcovs(Z)
cholcovs<-function(X, use="everything"){#Returns the cholesky decomposition for the diagonalization process uing the covariance matrix (maintains original varainces of variables)
  return(chol(stats::cov(X,use=use)))
}

Try the Omisc package in your browser

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

Omisc documentation built on Aug. 9, 2022, 5:09 p.m.