Learn R Programming

PlotNormTest (version 1.0.1)

Independent_transformation: Transformation to Independent Univariate Sample

Description

Leave-one-out method gives approximately independent sample of standard multivariate normal distribution, which then produces sample of standard univariate normal distribution.

Usage

Multi.to.Uni(x)

Value

Data frame contains univariate data and the index from multivariate data.

Arguments

x

multivariate data matrix

Details

Let \(\bar{X}_{-k} \) and \(S_{-k}\) are the sample mean sample variance covariance matrix obtained by using all but \(k^{th}\) data point. Then \(S_{-k}^{-1/2} (X_k - \bar{X}_{-k}) , k = 1,... n\) are approximately independently distributed as \(N_p(0, I)\). Thus all \(n \times p\) entries in the data matrix so constructed can be treated as univariate samples of size \(n \times p\) from \(N(0, 1)\).

Examples

Run this code
set.seed(1)
x <- MASS::mvrnorm(100, mu = rep(0, 5), diag(5))
df <- Multi.to.Uni(x)
qqnorm(df$x.new); abline(0, 1)

Run the code above in your browser using DataLab