Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pre.transform

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 S^(-1/2) and for pre-scaling, by S_D^(-1/2) where S is the sample variance and S_D is diag (S_1^2, S_2^2, ..., S_d^2) where S_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))

ks

Kernel Smoothing

v1.12.0
GPL-2 | GPL-3
Authors
Tarn Duong [aut, cre], Matt Wand [ctb], Jose Chacon [ctb], Artur Gramacki [ctb]
Initial release
2021-02-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.