Npreprocess: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Jeremy (Importing text file) |
||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Preprocessing of multi-way arrays. | Preprocessing of multi-way arrays. | ||
===Synopsis=== | ===Synopsis=== | ||
:[prex,prepar] = npreprocess(x,prepar,undo,options) | :[prex,prepar] = npreprocess(x,prepar,undo,options) | ||
:prex = npreprocess(x,setting) | :prex = npreprocess(x,setting) | ||
:prex = npreprocess(x,prepar) | :prex = npreprocess(x,prepar) | ||
:prex = npreprocess(x,prepar,1) | :prex = npreprocess(x,prepar,1) | ||
:options = npreprocess('options') | :options = npreprocess('options') | ||
===Description=== | ===Description=== | ||
NPREPROCESS is used for three different purposes: | NPREPROCESS is used for three different purposes: | ||
1) for centering and scaling multi-way arrays in which case the parameters (offsets and scales) are first calculated and then applied to the data, | 1) for centering and scaling multi-way arrays in which case the parameters (offsets and scales) are first calculated and then applied to the data, | ||
2) for preprocessing another data set according to (1), and | 2) for preprocessing another data set according to (1), and | ||
3) for transforming preprocessed data back (undo preprocessing). | 3) for transforming preprocessed data back (undo preprocessing). | ||
====INPUTS==== | ====INPUTS==== | ||
* '''x''' = data array, and | * '''x''' = data array, and | ||
* '''settings''' = a two-row matrix (class "double") indicating which modes to center and scale. The matrix is: settings = [cent; scal]. E.g. | * '''settings''' = a two-row matrix (class "double") indicating which modes to center and scale. The matrix is: settings = [cent; scal]. E.g. | ||
* '''settings(1,''':) = [1 0 1] => center across mode one and three, and | * '''settings(1,''':) = [1 0 1] => center across mode one and three, and | ||
* '''settings(2,''':) = [1 1 0] => scale to unit variance within mode one and two. | * '''settings(2,''':) = [1 1 0] => scale to unit variance within mode one and two. | ||
====OPTIONAL INPUTS==== | ====OPTIONAL INPUTS==== | ||
* '''''prepar''''' = contains earlier defined mean and scale parameters, this data is required for applying or undoing preprocessing, | * '''''prepar''''' = contains earlier defined mean and scale parameters, this data is required for applying or undoing preprocessing, | ||
* '''''undo''''' = when set to 1 this flag tells to undo/transform back, and | * '''''undo''''' = when set to 1 this flag tells to undo/transform back, and | ||
*'''''''' options'' = discussed below. | *'''''''' options'' = discussed below. | ||
====OUTPUTS==== | ====OUTPUTS==== | ||
* '''prex''' = the preprocessed data, and | * '''prex''' = the preprocessed data, and | ||
* '''prepar''' = a structure containing the necessary parameters to pre- and post-process other arrays. | * '''prepar''' = a structure containing the necessary parameters to pre- and post-process other arrays. | ||
===Options=== | ===Options=== | ||
* '''''options''''' = a structure array with the following fields: | * '''''options''''' = a structure array with the following fields: | ||
* '''display''': [ {'on'} | 'off' ], governs level of display, | * '''display''': [ {'on'} | 'off' ], governs level of display, | ||
* '''iterproc''': [ 'on' | {'off'} ], allows iterative preprocessing which is necessary for some combinations of centering and scaling (see User Manual), | * '''iterproc''': [ 'on' | {'off'} ], allows iterative preprocessing which is necessary for some combinations of centering and scaling (see User Manual), | ||
* '''scalefirst''': [ {'on'} | 'off' ], defines that scaling is done before centering which may have implications in complex combinations of preprocessing (see User Manual), and | * '''scalefirst''': [ {'on'} | 'off' ], defines that scaling is done before centering which may have implications in complex combinations of preprocessing (see User Manual), and | ||
* '''usemse''': [ {'on'} | 'off' ], defines that mean square scaling is used instead of scaling by standard deviations as is common in two-way analysis. | * '''usemse''': [ {'on'} | 'off' ], defines that mean square scaling is used instead of scaling by standard deviations as is common in two-way analysis. | ||
===Examples=== | ===Examples=== | ||
To apply preprocessing with options: | To apply preprocessing with options: | ||
:[prex,prepar] = npreprocess(x,settings,[],0,options); | :[prex,prepar] = npreprocess(x,settings,[],0,options); | ||
===See Also=== | ===See Also=== | ||
[[auto]], [[mncn]], [[preprocess]], [[rescale]], [[scale]] | [[auto]], [[mncn]], [[preprocess]], [[rescale]], [[scale]] |
Revision as of 15:26, 3 September 2008
Purpose
Preprocessing of multi-way arrays.
Synopsis
- [prex,prepar] = npreprocess(x,prepar,undo,options)
- prex = npreprocess(x,setting)
- prex = npreprocess(x,prepar)
- prex = npreprocess(x,prepar,1)
- options = npreprocess('options')
Description
NPREPROCESS is used for three different purposes:
1) for centering and scaling multi-way arrays in which case the parameters (offsets and scales) are first calculated and then applied to the data,
2) for preprocessing another data set according to (1), and
3) for transforming preprocessed data back (undo preprocessing).
INPUTS
- x = data array, and
- settings = a two-row matrix (class "double") indicating which modes to center and scale. The matrix is: settings = [cent; scal]. E.g.
- settings(1,:) = [1 0 1] => center across mode one and three, and
- settings(2,:) = [1 1 0] => scale to unit variance within mode one and two.
OPTIONAL INPUTS
- prepar = contains earlier defined mean and scale parameters, this data is required for applying or undoing preprocessing,
- undo = when set to 1 this flag tells to undo/transform back, and
- ''' options = discussed below.
OUTPUTS
- prex = the preprocessed data, and
- prepar = a structure containing the necessary parameters to pre- and post-process other arrays.
Options
- options = a structure array with the following fields:
- display: [ {'on'} | 'off' ], governs level of display,
- iterproc: [ 'on' | {'off'} ], allows iterative preprocessing which is necessary for some combinations of centering and scaling (see User Manual),
- scalefirst: [ {'on'} | 'off' ], defines that scaling is done before centering which may have implications in complex combinations of preprocessing (see User Manual), and
- usemse: [ {'on'} | 'off' ], defines that mean square scaling is used instead of scaling by standard deviations as is common in two-way analysis.
Examples
To apply preprocessing with options:
- [prex,prepar] = npreprocess(x,settings,[],0,options);
See Also
auto, mncn, preprocess, rescale, scale