2.8.23 normalize

Brief Information

Normalize XY data or data plot in graph

Command Line Usage

  1. normalize iy:=Col(2) method:=range;
  2. normalize iy:=Col(2) method:=specify val:=10;
  3. normalize iy:=Col(2) method:=mean oy:=<new>;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input iy

Input

XYRange

<active>

Specify the input curve or XYRange.

Data Info datainfo

Input

TreeNode

<unassigned>

This is for displaying the data information in the dialog. When you are using the X-Function by LabTalk, please do not use this variable.

Normalize Methods method

Input

int

1

Specify the method to normalize the input data
Option list

  • Specify:Divided by a specified value {0}
    Divide the data by a value specified by the val variable.
  • Range:normalize to [0, 1] {1}
    Normalize data to the range [0, 1]
  • Range100:Normalize to [0, 100] {13}
    Normalize data to the range [0, 100]. (9.0 SR0)
  • SND:Z scores (standardize to N(0, 1)) {2}
    Transform the data to the standard normal distribution.
  • Max:Divided by Max {3}
    Divide the data by the maximum Y value.
  • Min:Divided by Min {4}
    Divide the data by the minimum Y value.
  • Mean:Divided by Mean {5}
    Divide the data by the mean of the Y values.
  • Median:Divided by Median {6}
    Divide the data by the median of the Y values.
  • SD:Divided by SD {7}
    Divide the data by the standard deviation of the Y values.
  • Norm:Divided by Norm {8}
    Divide the data by the norm of the Y values.
  • Mode:Divided by Mode {9}
    Divide the data by the mode of the Y values. The mode is the element that appears most often in the dataset.
  • sum:Divided by Sum {10}
    Divide the vector by the sum of the Y values.
  • ref: Use Reference Column {11}
    Normalize the input data by matching the statistic specified by the type variable to that of a reference column specified by the refcol variable.
  • cell:Divided by Reference Cell {12}
    Divide the input data using a reference cell specified by the cell variable.
User-Defined Value val

Input

double

1.0

This variable is available only when method is set to specify. It specifies the value used to divide the input data.

Reference Column refcol

Input

Column

<optional>

This variable is available only when method is set to ref. It specifies the single column used as reference.

Normalize to type

Input

Int

0

This variable is available only when method is set to ref. It determines which statistical variable in reference column is used as the normalization match. After normalization, the chosen statistical variable of input column will match that of the reference column.

Option list:

  • min:Min
    Normalize the input columns such that the min value of each column matches that of the reference column.
  • max:Max
    Normalize the input columns such that the max value of each column matches that of the reference column.
  • mean:Mean
    Normalize the input columns such that the mean value of each column matches that of the reference column.
  • median:Median
    Normalize the input columns such that the median value of each column matches that of the reference column.
  • sum:Sum
    Normalize the input columns such that the sum of each column matches that of the reference column.
Reference Cell cell

Input

Range

<optional>

This variable is available only when method is set to cell. It specifies the single cell used as reference.

Output oy

Output

XYRange

(<input>,<new>)

Specify the output for the normalized data.

See the syntax here.

Examples

The following script will show you an example of normalizing a curve by dividing it by a user defined value.

string fn$=system.path.program$ + "\Samples\Curve Fitting\Exponential Decay.dat "; 
impASC fname:=fn$;
normalize iy:=(1,2) method:=specify val:=5 oy:=<new>;

Then two columns are added to the input worksheet. One stores the x values and other stores the normalized y values.

Algorithm

Suppose Y is the y values of input data, and \alpha is a user defined value, the normalized data, Y{}' can be calculated as follows:

Divided by a specific value:

Y{}'=\frac{Y}{\alpha }

Normalize to [0, 1]:

Y{}'=\frac{Y-Y_{min}}{Y_{max}-Y_{min}}

Normalize to [0, 100]:

Y{}'=\frac{100(Y-Y_{min})}{Y_{max}-Y_{min}}

Z scores (standardize to N(0, 1)):

Y{}'=\frac{Y-Y_{min}}{Y_{SD}}

Divided by Max:

Y{}'=\frac{Y}{Y_{max}}

Divided by Min:

Y{}'=\frac{Y}{Y_{min}}

Divided by Mean:

Y{}'=\frac{Y}{Y_{mean}}

Divided by Median:

Y{}'=\frac{Y}{Y_{median}}

Divided by Standard Derivation:

Y{}'=\frac{Y}{Y_{SD}}

Divided by Norm:

Y{}'=\frac{Y}{\left \| Y \right \|}

\left \| Y \right \|=\sqrt{y_1^2+\cdots +y_n^2}

y_n is the n th y values.

Divided by Mode:

Y{}'=\frac{Y}{Y_{mode}}

Divided by Sum:

Y{}'=\frac{Y}{Y_{sum}}

Related X-Functions

vnormalize, Rnormalize, Cnormalize