in reply to number normalization

(sorry if this shows up twice, i didn't see it the first time i posted it).

how about an equation that would normalize a number based on a non-linear equation similar to this equation ($hi and $lo are the $hi and $lo values in the dataset, and $HIVAL and $LOVAL are the output ranges for the normalized dataset)

$num = 1 + ($output{$key}-$lo)*($HIVAL-$LOVAL)/($hi-$lo);

thanks for all your input!!

Replies are listed 'Best First'.
Re: Re: number normalization
by fglock (Vicar) on Aug 10, 2003 at 18:15 UTC

    You can do that by composing my answer with japhy's:

    $l2 = 5; $h2 = 15; @data = ( 0.03, 0.1, 0.15, 0.5, 0.7 ); # exponential normalization $l1 = 0.03; $h1 = 0.7; ($l1,$h1) = map { 10**$_ } ($l1,$h1); @normalized = map { $l2 + (10**$_ - $l1) * ($h2 - $l2) / ($h1 - $l1) } @data; print " @normalized \n"; # 5 5.47560740136863 5.86545098040508 10.306017857952 15 # logarithmic normalization $l1 = 0.03; $h1 = 0.7; ($l1,$h1) = map { log($_) } ($l1,$h1); @normalized = map { $l2 + (log($_) - $l1) * ($h2 - $l2) / ($h1 - $l1) } @data; print " @normalized \n"; # 5 8.82227791363971 10.1095165638026 13.9317944774423 15