Learn R Programming

MultiStatM (version 2.0.0)

MVStandardize: Standardize multivariate data

Description

For data formed by d-variate vectors x with sample covariance S and sample mean M, it computes the values \(z=S^{-1/2}(x-M)\)

Usage

MVStandardize(x)

Value

a matrix of multivariate data with null mean vector and identity sample covariance matrix

Arguments

x

a multivariate data matrix, sample size is the number of rows

Examples

Run this code
x<-MASS::mvrnorm(1000,c(0,0,1,3),diag(4))
z<-MVStandardize(x)
mu_z<- apply(z,2,mean)
cov_z<- cov(z)

Run the code above in your browser using DataLab