pre.transform function

Pre-sphering and pre-scaling

Pre-sphering and pre-scaling

Pre-sphered or pre-scaled version of data.

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.

Returns

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.

Details

For pre-scaling, the data values are pre-multiplied by S(1/2)S^(-1/2) and for pre-scaling, by SD(1/2)S_D^(-1/2) where SS is the sample variance and SDS_D

is c("diag(S12,\ndiag (S_1^2,\n", "S22,...,Sd2) S_2^2, ..., S_d^2)") where Si2S_i^2 is the i-th marginal sample variance.

Examples

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