3

I want to normalize a series of numbers to all be between -1 and 1, but I would like to do it in a way where the relative difference between price elements stays the same, if possible.

Example list of price series price_list = np.array([4.8, 7.2, 5.0, 8.1])

I use this equation to normalize between -1 and 1. (2*(price_list - min(price_list)) / (max(price_list) - min(price_list)))-1 This returns array([-1. , 0.45454545, -0.87878788, 1. ])

Let's take the ratio between the 0th and 1st non-normalized values. 4.8 / 7.2 = 0.6666666666666666 But the ratio of the 0th and 1st elements in the normalized list is -1 / 0.45454545 = -2.200000022

I would like the data normalized between -1 and 1 in a way that the ratio is also 0.6666666666666666.

Peter Mortensen
  • 271
  • 3
  • 8
Renoldus
  • 141
  • 4

1 Answers1

6

This is not possible.

Consider only 2 numbers, $a$ and $b$. The ratio of one to the other will be $a/b$. But after scaling the larger will become 1, the smaller $-$1, and the ratio will always be $-$1.

Note that ratios change when numbers are added or subtracted. If your extreme values are symmetric around 0, say your largest value is $a$ and your smallest is $-a$, then you can simply divide everything by $a$ to get the desired scaling. But if you have to shift the dataset by addition or subtraction, then ratios will change.

Nick Cox
  • 48,377
  • 8
  • 110
  • 156
David Luke Thiessen
  • 1,232
  • 2
  • 15
  • OP: Thinking that price ratios make sense is equivalent to working with price on a logarithmic scale, which I would recommend over the _ad hoc_ normalized ratio approach, which as nicely shown here introduces more problems than it solves. – Nick Cox Aug 02 '21 at 10:48