# 2.8.33 vnormalize

## Brief Information

Normalize a vector

## Command Line Usage

 

 vnormalize ix:=Col(1) method:=range; vnormalize ix:=Col(1) method:=specify val:=10; vnormalize ix:=Col(1) method:=means ox:=<new>; 

## Variables

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

Input

vector

<active>

Specify the input vector data or column.

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 used to normalize the data.
Option list:

• specify:Divided by a specified value {0}
Divide the vector by a specified value.
• 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 to standard normal distribution.
• max:Divided by Max {3}
Divide the vector by the maximum value.
• min:Divided by Min {4}
Divide the vector by the minimum value.
• mean:Divided by Mean {5}
Divide the vector by the mean.
• median:Divided by Median {6}
Divide the vector by the median.
• sd:Divided by SD {7}
Divide the vector by the standard deviation.
• norm:Divided by Norm {8}
Divide the vector by the Norm.
• mode:Divided by Mode {9}
Divide the vector by the mode.
• sum:Divided by Sum {10}
Divide the input data input data by the sum.
• 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 vector.

Reference Column refcol

Input

Column

<optional>
This variable is available only when method is set to ref. It specifies the reference single column.
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 to divide the input data.
Output ox

Output

vector

<input>

Specify the output for the normalized vector.

## Description

This function performs normalization to a vector.

## Examples

To normalize the second column by dividing the mean, and output result to a new column, type the following in the Command Window:

vnormalize ix:=Col(4) method:=Mean ox:=<new>;

## Algorithm

Suppose $V$ is the input vector, and $\alpha$ is a user defined value, the normalized vector, $V{}'$ can be computated as follows: $V{}'=\frac{V}{\alpha }$

Normalize to [0, 1]: $V{}'=\frac{V-V_{min}}{V_{max}-V_{min}}$

Normalize to [0, 100]: $V{}'=\frac{100(V-V_{min})}{V_{max}-V_{min}}$

Z scores (standardize to N(0, 1)): $V{}'=\frac{V-V_{min}}{V_{SD}}$

Divided by Max: $V{}'=\frac{V}{V_{max}}$

Divided by Min: $V{}'=\frac{V}{V_{min}}$

Divided by Mean: $V{}'=\frac{V}{V_{mean}}$

Divided by Median: $V{}'=\frac{V}{V_{median}}$

Divided by Standard Derivation: $V{}'=\frac{V}{V_{SD}}$

Divided by Norm: $V{}'=\frac{V}{\left \| V \right \|}$ $\left \| V \right \|=\sqrt{v_1^2+\cdots +v_n^2}$ $v_n$ is the n th $V$ values.

Divided by Mode: $V{}'=\frac{V}{V_{mode}}$

Divided by Sum: $V{}'=\frac{V}{V_{sum}}$