PLS_Toolbox Documentation: gscaler< gscale gselect >

gscaler

Purpose

GSCALER Applies group/block scaling to submatrices of a single matrix.

Synopsis

 

gys = gscaler(yin,numblocks,mxs,stdxs)

Description

Inputs are a matrix yin (class "double"), the number of sub-matrices or blocks numblocks, an offset vector mxs, and a scale vector stdxs. See GSCALE for descriptions of mxs and stdxs. Note that size(yin,2)/numblocks must be an integer and will most often have the same value as input numblocks in the call to GSCALE that returned mxs and stdxs.

Examples

Scale a matrix a that has two blocks augmented together using GSCALE:

>> a = [[1 2 3; 4 5 6; 7 8 9] [11 12 13; 14 15 16; 17 18 19]];

>> [gxs,mxs,stdxs] = gscale(a,2);

>> gxs

gxs =

   -0.5774   -0.5774   -0.5774   -0.5774   -0.5774   -0.5774

         0         0         0         0         0         0

    0.5774    0.5774    0.5774    0.5774    0.5774    0.5774

>> mxs

mxs =

     4     5     6    14    15    16

>> stdxs

stdxs =

     3     3     3     3     3     3

Now scale a new matrix b that has two blocks augmented together:

>> b = [[2 3 4; 4 5 6; 6 7 8] [10 11 12; 14 15 16; 18 19 20]]

b =

     2     3     4    10    11    12

     4     5     6    14    15    16

     6     7     8    18    19    20

>> gys = gscaler(b,2,mxs,stdxs)

gys =

   -0.3849   -0.3849   -0.3849   -0.7698   -0.7698   -0.7698

         0         0         0         0         0         0

    0.3849    0.3849    0.3849    0.7698    0.7698    0.7698

See Also

gscale, scale


< gscale gselect >