What is the name of this data preparation?

365 Views Asked by At

I have a two-dimensional array ($569\times30$ double) which should be normalized using this formula:

$x'_{ij} = \dfrac{x_{ij}}{10^h} $

What is the name of this normalization and how can I do that in Matlab?

Edit:

$h$ is depended on array entries, it should be a decimal number to make all data between desired min and max values.

2

There are 2 best solutions below

3
On BEST ANSWER

Assuming you have a matrix X with a desired minimum and maximum for the entire matrix, then it is not hard to find upper and lower bounds for h:

ratio_max = max(X)/maximum;
ratio_min = min(X)/minimum;
h_min = log10(ratio_max)
h_max = log10(ratio_max)

Note that depending on your input, h_min might be larger than h_max in which case there is no valid value for which your criteria are met. Also the value might not be finite, in which case this solution might require a manual adjustment.

Now, just pick a value to normalize with, for example somewhere in the middle of the range and perform the operation:

h = (h_min + h_max)/2;
X_normalized = X / 10^h;
0
On

Final m-file is:

function [normalized] = p1_normalize_h(dataset)
dataset_max = max(max(dataset));
dataset_min = min(min(dataset));
h = max(abs(dataset_min), abs(dataset_max));
h = log10(h);
normalized = dataset / 10^h;