0
$\begingroup$

I am trying to get a continuous mapping from (0,∞) to (0,1). What would be a good mapping?

Context:
I need to rank tuples based on values of two of their attributes a and b. a increases very steeply and b much slower. To accomodate both of them in ranking, I am generating c=a*b and am using that for ranking. c could vary from sub-1 values to a few billions. this makes comparison very difficult. I tried log10(c)..while that helps in reducing the range significantly, having a proper way to map the values to (0,1) would help. I am trying to look for a function to map c to (0,1) that would have a good spread over entire range of the iterval (0,1).I considered sigmoid, but then I thought since all values are psoitive, sigmoid values would be restricted to (0.5,1)..so had to drop that idea..

  • 0
    Then $x\mapsto\log(1+x)/(1+\log(1+x))$ or even $x\mapsto\log(1+x)/(c+\log(1+x))$ for some suitable positive $c$.2012-04-12

2 Answers 2

3

$\displaystyle f(x) = \frac{1}{x+1}$. The endpoints give it away: we'd like $ \infty$ to go to 0 or 1. Well, we can do $ \infty$ going to 0 easily by $x \to \frac{1}{x}$. But this function doesn't work near 0. Ah, we can shift it along.

  • 1
    Or for that matter $f(x)=\dfrac1{(x+1)^a}$ for any a>0.2012-04-12
2

An obvious one would be x going to $\frac{\tan^{-1}{x}}{\pi/2} $, but you may prefer something else depending on more info you may have about the variable.

  • 1
    I suppose most of the sigmoidal functions ($\arctan$, $\tanh$, $\mathrm{erf}$, etc...) work nicely, with suitable normalization...2012-04-14