Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rescaling ranges

for example i have two ranges

                       (1) 0 to 3
                       (2) 10 to 15

in range (1) i have numbers between 0 and 3, where 0 is minimum and 3 is maximum value...(it has also values 1 and 2)...

now i wanted to rescale both ranges (1) and (2) to range 0 to 1. Can you show me how to do it or at least point to helpful sites? thanks a lot!

like image 974
asel Avatar asked Sep 21 '09 18:09

asel


People also ask

How do you calculate rescaled range?

The rescaled range is calculated by dividing the range (maximum value minus minimum value) of the cumulative mean adjusted data points (sum of each data point minus the mean of the data series) by the standard deviation of the values over the same portion of the time series.

How to calculate range in time series?

The range is calculated by subtracting the lowest value from the highest value.

How do you calculate Hurst exponent?

The Hurst Exponent is estimated by fitting the power-law E[R(n)/S(n)]=C×nH to the data. This is done by taking the logarithm of both sides, and fitting a straight line. The slope of the line gives H (i.e. Hurst Exponent Estimate).

What is Hurst exponent in stock market?

Hurst exponent measures the long-term memory and fractality of a time series. It is known [7] that a Hurst value of 0.5 implies a Brownian random process.


1 Answers

What you're describing is called linear interpolation.

For the general case, suppose you have a value c between a and b, and you want a value x between 0 and 1 which is based on c's relative position between a and b. The equation for x is as follows:

x := (c - a) / (b - a)

So if you have a value between 10 and 15 (let's say 11), and you want a value between 0 and 1, you punch the values into the equation above:

x := (11 - 10) / (15 - 10)
x := 1/5

In other words, 11 is one-fifth of the way from 10 to 15.


The even more general case (when you have a value c between a and b and you want a value x between y and z), x is calculated as follows:

x := (c - a) * (z - y) / (b - a) + y

In your case, z = 1 and y = 0.

like image 71
Welbog Avatar answered Jan 04 '23 11:01

Welbog