Skip to main content
Tweeted twitter.com/StackStats/status/1424294335399567362
Fixed the question formation - missing auxiliary (or helping) verb - see e.g. <https://www.youtube.com/watch?v=t4yWEt0OSpg&t=1m49s> (see also <https://www.youtube.com/watch?v=kS5NfSzXfrI> (QUASM)).
Source Link

How tocan I normalize price history between -1 and 1 while keeping the ratio of price differences to each other the same?

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.

How to normalize price history between -1 and 1 while keeping the ratio of price differences to each other the same?

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.

How can I normalize price history between -1 and 1 while keeping the ratio of price differences to each other the same?

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.

Became Hot Network Question
edited tags
Link
whuber
  • 333.5k
  • 63
  • 792
  • 1.3k
Source Link

How to normalize price history between -1 and 1 while keeping the ratio of price differences to each other the same?

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.