Scale: Difference between revisions
imported>Jeremy (Importing text file) |
imported>Jeremy (Importing text file) |
||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Scales data using specified means and std. devs. | Scales data using specified means and std. devs. | ||
===Synopsis=== | ===Synopsis=== | ||
:sx = scale(x,means,''stds,options'') | :sx = scale(x,means,''stds,options'') | ||
===Description=== | ===Description=== | ||
sx = scale(x,means) subtracts a vector means from a matrix x and returns the result as sx. If means is the vector of means this routine mean centers x. | sx = scale(x,means) subtracts a vector means from a matrix x and returns the result as sx. If means is the vector of means this routine mean centers x. | ||
sx = scale(x,means,''stds'') subtracts a vector means from a matrix x, divides each column by the corresponding element in the vector ''stds'' and returns the result as sx. If means is the vector of means and ''stds'' is the vector of standard deviations this routine atuo-scales x so that each column of sx has zero mean and unit variance. | sx = scale(x,means,''stds'') subtracts a vector means from a matrix x, divides each column by the corresponding element in the vector ''stds'' and returns the result as sx. If means is the vector of means and ''stds'' is the vector of standard deviations this routine atuo-scales x so that each column of sx has zero mean and unit variance. | ||
The optional input options is an options structure contianing the field "stdthreshold" which defines a threshold value for standard deviation below which the threshold value will be used in lieu of the actual value. A scalar value is used as a threshold for all variables. A vector is assumed to be equal in length to stds and describes the threshold to use on each individual element. | The optional input options is an options structure contianing the field "stdthreshold" which defines a threshold value for standard deviation below which the threshold value will be used in lieu of the actual value. A scalar value is used as a threshold for all variables. A vector is assumed to be equal in length to stds and describes the threshold to use on each individual element. | ||
===See Also=== | ===See Also=== | ||
[[auto]], [[gscaler]], [[medcn]], [[mncn]], [[npreprocess]], [[preprocess]], [[rescale]] | [[auto]], [[gscaler]], [[medcn]], [[mncn]], [[npreprocess]], [[preprocess]], [[rescale]] |
Revision as of 14:26, 3 September 2008
Purpose
Scales data using specified means and std. devs.
Synopsis
- sx = scale(x,means,stds,options)
Description
sx = scale(x,means) subtracts a vector means from a matrix x and returns the result as sx. If means is the vector of means this routine mean centers x.
sx = scale(x,means,stds) subtracts a vector means from a matrix x, divides each column by the corresponding element in the vector stds and returns the result as sx. If means is the vector of means and stds is the vector of standard deviations this routine atuo-scales x so that each column of sx has zero mean and unit variance.
The optional input options is an options structure contianing the field "stdthreshold" which defines a threshold value for standard deviation below which the threshold value will be used in lieu of the actual value. A scalar value is used as a threshold for all variables. A vector is assumed to be equal in length to stds and describes the threshold to use on each individual element.
See Also
auto, gscaler, medcn, mncn, npreprocess, preprocess, rescale