Polytransform: Difference between revisions
imported>Donal |
imported>Donal No edit summary |
||
Line 5: | Line 5: | ||
===Synopsis=== | ===Synopsis=== | ||
:[ | :[xout, model] = polytransform(x, options); | ||
===Description=== | ===Description=== | ||
Line 16: | Line 16: | ||
* '''x''' = Dataset or matrix to be augmented by the addition of transformed variables. | * '''x''' = Dataset or matrix to be augmented by the addition of transformed variables. | ||
====Outputs==== | |||
* '''xout''' = The augmented dataset or matrix. | |||
===Options=== | ===Options=== | ||
'''''options''''' is a structure array with the following fields: | '''''options''''' is a structure array with the following fields: | ||
* '''display''': [ {'on'} | 'off' ], governs level of display, | * '''squares''': [ 'on' | {'off'} ], governs level of display, | ||
* ''' | * '''cubes''': [ 'on' | {'off'} ], governs level of display, | ||
* | * '''quadratics''': [ 'on' | {'off'} ], governs level of display, | ||
* '''crossterms''': [ 'on' | {'off'} ], governs level of display, | |||
* ''' | * '''preprocessingtype''': ['none' | 'mncn' | {'auto'} | 'pcrtile' | 'custom'], governs data preprocessing behavior, | ||
* '''preprocessing''': A preprocessing structure which is used if ''preprocessingtype = custom'', | |||
* '''pca''': [ 'on' | {'off'} ], governs whether PCA is applied to the preprocessed data before transformed terms are calculated, | |||
* '''maxpcs''': Integer indicating how many PCs to use if ''pca = on'', | |||
* '''preprocessoriginalvars''': [ 0| {1} ], governs whether the original variables are returned preprocessed or raw. | |||
===Examples=== | ===Examples=== |
Revision as of 12:59, 27 September 2010
Purpose
Add new variables to a dataset object or matrix formed as power transforms and cross terms of the original variables.
Synopsis
- [xout, model] = polytransform(x, options);
Description
Add polynomial and cross terms to data matrix or dataset. Input dataset x has new transformed variables added. These can include existing variables raised to second, third, fourth power, or second order product of variables. The data can be preprocessed before transformed variables are calculated. preprocessingtype option specifies the type of preprocessing to apply, 'none', 'mncn', 'auto', or 'custom'. If 'custom' is specified then the 'preprocessing' option must be a valid preprocessing structure. If pca = 'on' the data are converted to PCA scores after preprocessing, but before the transformed variables are calculated.
Inputs
- x = Dataset or matrix to be augmented by the addition of transformed variables.
Outputs
- xout = The augmented dataset or matrix.
Options
options is a structure array with the following fields:
- squares: [ 'on' | {'off'} ], governs level of display,
- cubes: [ 'on' | {'off'} ], governs level of display,
- quadratics: [ 'on' | {'off'} ], governs level of display,
- crossterms: [ 'on' | {'off'} ], governs level of display,
- preprocessingtype: ['none' | 'mncn' | {'auto'} | 'pcrtile' | 'custom'], governs data preprocessing behavior,
- preprocessing: A preprocessing structure which is used if preprocessingtype = custom,
- pca: [ 'on' | {'off'} ], governs whether PCA is applied to the preprocessed data before transformed terms are calculated,
- maxpcs: Integer indicating how many PCs to use if pca = on,
- preprocessoriginalvars: [ 0| {1} ], governs whether the original variables are returned preprocessed or raw.
Examples
If y is a 5 by 100 matrix, x is a 1 by 100 vector, and xi is a 1 by 91 vector then:
polyinterp(x,y,xi,11,3,1)
gives the 5 by 91 matrix of first-derivative row vectors resulting from an 11-point cubic interpolation to the 91 points in xi.