Normalizing data to a given value.

8.1k Views Asked by At

I would like compare the data by normalizing it to a given value.

for example: [20,30,40,50,60,70] How do I normalize the given set of elements to its first value, that is, 20. Please also let me know if did not understand it correctly.

I understand that I need to take the mean and the standard deviation; then subtract mean, then divide by the standard deviation.

Is that correct?

3

There are 3 best solutions below

3
On BEST ANSWER

Normalizing as in your third paragraph is not tied to a particular value. It uses the whole data set and changes it to one with zero mean and unit standard deviation. Do you understand how to calculate the mean and standard deviation of your data?

There are various normalizations that you could use that do depend on the first value. You could just subtract the first value from each data point. That will make the first zero and show you how much each data point differs from the first. You could divide by the first point instead (assuming it is not zero). Unless your data is ordered in some way, it seems strange to single out one point for special treatment.

0
On

$\newcommand{\+}{^{\dagger}}% \newcommand{\angles}[1]{\left\langle #1 \right\rangle}% \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}% \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}% \newcommand{\dd}{{\rm d}}% \newcommand{\isdiv}{\,\left.\right\vert\,}% \newcommand{\ds}[1]{\displaystyle{#1}}% \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}% \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}% \newcommand{\fermi}{\,{\rm f}}% \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}% \newcommand{\ic}{{\rm i}}% \newcommand{\imp}{\Longrightarrow}% \newcommand{\ket}[1]{\left\vert #1\right\rangle}% \newcommand{\pars}[1]{\left( #1 \right)}% \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}}% \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}% \newcommand{\sech}{\,{\rm sech}}% \newcommand{\sgn}{\,{\rm sgn}}% \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}}% \newcommand{\verts}[1]{\left\vert #1 \right\vert}% \newcommand{\yy}{\Longleftrightarrow}$ Normalizing is an usual procedure whenever we use a numerical calculation. It serves to the purposes of avoid overflows. It's usual to take the element with the greatest magnitude. For this small set of data it doesn't seem necessary. However, it's done like this: $$ \angles{x} = {1 \over 6}\sum_{n = 2}^{7}10n = \pars{35 \over 3}\sum_{n = 2}^{7}\pars{n \over 7} $$ Operations (in the numerical side) are performed as indicated by the $\pars{\cdots}$'s.

Similarly, $$ \angles{x^{2}} = {1 \over 6}\sum_{n = 2}^{7}100n^{2} = \pars{2450 \over 3}\sum_{n = 2}^{7}\pars{n \over 7}^{2} $$ For example $\pars{~\mbox{in}\ {\tt C++}~}$, the following function evaluates $\angles{x}$ and $\angles{x^{2}}$ $\pars{~\mbox{as}\ {\tt xAvg}\ \mbox{and}\ {\tt x2Avg},\ \mbox{respectively}~}$:

void function(double &xAvg,double &x2Avg}
{
 xAvg=x2Avg=0;
 double temp;
 for ( size_t n = 2U ; n<8U ; ++n ) {
     temp=n/7.0;
     xAvg+=temp;
     x2Avg+=temp*temp;
 }
 xAvg*=(35.0/3.0);
 x2Avg*=(2450.0/3.0);
}
0
On

There are indeed many ways of normalizing data. One I toyed with is transforming actual numbers into the sum of $\beta^j$.

If you let $\alpha = x^{-1}$ and $\beta = 1 - \alpha$, you can then recreate the data set with sums of $\beta^j$, where $y_\text{est} = \frac{1 - \beta}{\beta^j}$.

This procedure has the effect of gradually decreasing the weight of less probable numbers.