pre.transform {ks}R Documentation

Pre-sphering and pre-scaling

Description

Pre-sphered or pre-scaled version of data.

Usage

pre.sphere(x, mean.centred=FALSE)
pre.scale(x, mean.centred=FALSE)

Arguments

x

matrix of data values

mean.centred

flag to centre the data values to have zero mean. Default is FALSE.

Details

For pre-scaling, the data values are pre-multiplied by S1/2\mathbf{S}^{-1/2} and for pre-scaling, by SD1/2\mathbf{S}_D^{-1/2} where S\mathbf{S} is the sample variance and SD\mathbf{S}_D is diag(S12,S22,,Sd2)\mathrm{diag} \, (S_1^2, S_2^2, \dots, S_d^2) where Si2S_i^2 is the i-th marginal sample variance.

Value

Pre-sphered or pre-scaled version of data. These pre-transformations are required for implementing the plug-in Hpi selectors and the smoothed cross validation Hscv selectors.

Examples

data(unicef)
unicef.sp <- pre.sphere(as.matrix(unicef))

[Package ks version 1.14.2 Index]